【发布时间】:2015-11-29 09:47:08
【问题描述】:
我的函数有问题。 一旦我从带有唯一链接的 php 端服务器的 XMLHttpRequest 打印页面,它就无法识别 php 端服务器页面中的脚本。它说 Jquery 中的未定义函数。
谢谢。
if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
} else { // code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
var iDiv = document.createElement('div');
iDiv.id = '22';
iDiv.className = '2323';
iDiv.innerHTML = xmlhttp.responseText;
iDiv.innerHTML += '<script type=\"text/javascript\" src=\"https://d3v2hnl706774i.cloudfront.net/html/iframeResizer.min.js\"></script>';
iDiv.innerHTML += '<script type=\"text/javascript\">iFrameResize({log: false,enablePublicMethods: true,enableInPageLinks: true,minHeight: 300});</script>';
document.getElementsByTagName('body')[0].appendChild(iDiv);
thisScriptElement.parentNode.insertBefore(iDiv, thisScriptElement);
thisScriptElement.parentNode.removeChild(thisScriptElement);
}
}
xmlhttp.open("GET", theUrl, true);
xmlhttp.send(null);
}
【问题讨论】:
-
好的,我明白了,但我不明白如何将 RVAL() 函数插入到我的代码中。你能帮我解决这个问题吗?
-
什么是 RVAL(),它现在去哪儿了?
-
我在这里有分析器:stackoverflow.com/questions/4619668/… 答案是 javascript 调用 rval() 中的函数,但我不明白我需要如何插入到我的代码中
标签: javascript php jquery html