IE在jQuery加载函数中具有动态URL的难度。
这是我的代码片段:
var formValues = $('#testing').serialize();
var URL = "test.cfm?" + formValues;
var dialogOpts = {
modal: true,
bgiframe: true,
autoOpen: true,
height: 500,
width: 500,
draggable: true,
resizable: false,
closeOnEscape: false,
open: function() {
//display correct dialog content
$("#dialogContainer").load(URL}
};
$("#dialogContainer").dialog(dialogOpts);
现在请注意,如果我将URL更改为静态内容,例如“thisHTMLfile.html”,这将在FF和IE中完美运行。 但由于URL是动态IE barfs。 我得到一个空白的对话框。 好像IE不会进行ajax调用。
我已经尝试了在字符串中放置一个随机值以使其成为唯一URL的想法,以便IE不会缓存url,也不会骰子。
我还检查了test2.cfm文件是否存在任何HTML错误。 这里没问题。
有人遇到过这个吗?
谢谢!
@ Karim79:是的,这会搞砸我,但那只是我在这里输入屏幕。 但是我的代码是正确的。
我确实弄明白了这个问题。 我的Coldfusion localhost将内部调试设置为ON。 它向我展示了为页面运行的所有代码和进程。 我认为这个额外的代码喷出了IE barf。 所以我关闭了调试输出和瞧。 我的IE 6头疼再见… ?
它可能只是一个错字,但这看起来很可疑:
open: function() { //display correct dialog content $("#dialogContainer").load(URL} <<< this curly brace }; open: function() { //display correct dialog content $("#dialogContainer").load(URL) <<< should be a closing parentheses ')' };
以上就是jQuery教程分享jQuery .load()函数+ IE +动态URL =脱发相关内容,想了解更多jQuery开发(异常处理)及jQuery教程关注计算机技术网(www.ctvol.com)!)。
本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。
ctvol管理联系方式QQ:251552304
本文章地址:https://www.ctvol.com/jquerytutorial/558077.html