通过ajax加载的php页面如下所示
<script type="text/javascript">
function getXMLHTTP()
{
var xmlhttp=false;
try
{
xmlhttp=new XMLHttpRequest();
}
catch(e)
{
try
{
xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e)
{
try
{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e1)
{
xmlhttp=false;
}
}
}
return xmlhttp;
}
function load_field(form)
{
var tabname=form.uname.options[form.uname.options.selectedIndex].value;
if(tabname=='select')
alert("Please Select table");
else
{
strURL='user_right_data.php?uname='+tabname;
var req = getXMLHTTP();
if (req)
{
req.onreadystatechange = function() {
if (req.readyState == 4) {
if (req.status == 200) {
document.getElementById('fielddiv').innerHTML=req.responseText;
} else {
alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}
}
req.open("GET", strURL, true);
req.send(null);
}
}
}
</script>
<script type="text/javascript">
window.onload = function ()
{
compactMenu('someID',false,'± ');
}
</script>
php页面有ul id="someID"
问题是compactMenu('someID',false,'± ');
脚本无法处理动态加载的内容
compactMenu('someID',false,'± ');
正在工作
在加载ajax的内容上运行脚本的解决方案是什么?
compactMenu('someID',false,'± ');
的来源
是https://code.google.com/p/firecrystal/source/browse/trunk/firecrystal/chrome/content/replay/html/listCollapse.js?r=2