0

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 中完美运行。但由于 IE 的 URL 是动态的 barfs。我得到一个空白对话框。就好像 IE 不会进行 ajax 调用一样。

我已经尝试在字符串中放置一个随机值以使其成为唯一的 url,这样 IE 就不会缓存 url,没有骰子。

我还检查了 test2.cfm 文件是否有任何 HTML 错误。这里没有问题。

有没有人遇到过这个?

谢谢!

4

2 回答 2

1

@Karim79:是的,那会搞砸我,但这只是我在这里输入屏幕。不过,这在我的代码上是正确的。

我确实弄清楚了这个问题。我的 Coldfusion localhost 已将内部调试设置为 ON。它向我显示了为该页面运行的所有代码和进程。我认为这个额外的代码喷出让 IE 呕吐。所以我关闭了调试输出,瞧。我的 IE 6 头痛已经过去了 :)

于 2009-06-21T08:43:28.607 回答
0

这可能只是一个错字,但这看起来很可疑:

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 ')'
};
于 2009-06-21T08:38:53.687 回答