我遇到了运行在JQuery下运行的第二个进程的问题,如下面的代码。如何重新加载jQuery,以便它可以用于下一个进程
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head>
<body>
<script type="text/javascript" src='jquery-1.6.2.min.js'> </script>
<div id="displayArea1">
</div>
<br/>
<div id="displayArea2">
</div>
<input id="btnSet" type="button" value="Set The Value" />
<script>
//The input that should i use
var itemToPrintOut1 = "[Input1 (working)] Search <strong style='cursor:pointer' title='Click here'>IP{<span id='ip1'>192.168.2.56,192.168.2.89,192.168.2.75</span>}</strong> that has accessed to MAIL-SERVER{192.168.2.8}";
var itemToPrintOut2 = "[Input2 (not working)] Search <strong style='cursor:pointer' title='Click here'>IP{<span id='ip2'>192.168.2.56,192.168.2.89,192.168.2.75</span>}</strong> that has accessed to MAIL-SERVER{192.168.2.8}";
$("#displayArea1").html(itemToPrintOut1); //If I enable this line, it is works as what i want(because it is using jquery)
$("#btnSet").click(function(){
$("#displayArea2").html(itemToPrintOut2);
});
$("#ip1").click(function(){
alert("Normal method, data = " + $("#ip1").html());
});
$("#ip2").click(function(){
alert("The method I should use, data = " + $("#ip2").html());
});
</script>
</body>
第一次(在加载),它会显示itemToPrintOut1
文字,我可以点击的IP地址。我没有问题!
但是,当我点击按钮并显示第二个文本itemToPrintOut2
,我无法再点击IP。
任何人都可以帮助我确定第二个输出可以与JQUERY一起使用。有很多事情也与我的这个问题有关。 它与JQuery加载有关吗?
感谢
工作!谢谢 – 2012-07-25 07:45:37