Javascript jquery中断其他脚本
首先,我对脚本一无所知,几乎不懂HTML 总之,我发现了这个:Javascript jquery中断其他脚本,javascript,jquery,Javascript,Jquery,首先,我对脚本一无所知,几乎不懂HTML 总之,我发现了这个: <script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script> <script type="text/javascript"> function showThis2(x) { $("#NContent").html(
<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
function showThis2(x) {
$("#NContent").html( $("#"+x).html());
};
</script>
<a href="#Nut" onclick="showThis1('1');">1</a>
<a href="#Nut" onclick="showThis2('2');">2</a>
<div id="NContent"></div>
但我不能让它工作,我可能没有正确地放置它或其他东西
希望有人能帮忙
谢谢 听起来您已经加载了两次jQuery。尝试删除第一个脚本标记,看看会发生什么 另外,jQuery1.3.2实际上已经过时了。1.10.2是最新版本。当您使用
var jQuery_latest = $.noConflict(true);
然后,$
变量就不再是jQuery了。您必须将脚本更改为
<script type="text/javascript">
function showThis2(x) {
jQuery_latest("#NContent").html(jQuery_latest("#"+x).html());
};
</script>
函数showThis2(x){
jQuery_latest(“#NContent”).html(jQuery_latest(“#”+x.html());
};
小心不要在jQuery中多次添加load,它也可能会产生冲突。在源代码视图中检查所有脚本标记,并提供其中的内容列表(来自每个标记的src)。如果jQuery已经加载到页面中,则不需要创建
noConflict
<script type="text/javascript">
function showThis2(x) {
jQuery_latest("#NContent").html(jQuery_latest("#"+x).html());
};
</script>