tags:

views:

1874

answers:

4

IE is having diffculty with dynamic urls in the jQuery load function.

Here's my code snippet:

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);

Now mind you, if I changed URL to something static like "thisHTMLfile.html", this will work flawlessly in FF and IE. But since the URL is dynamic IE barfs. I get a blank dialog. It's as if IE won't do the ajax call.

i've tried the idea of putting a random value in the string to make it a unique url so that IE won't cache the url, no dice.

I've also checked the test2.cfm file for any HTML errors. No problems here.

Has anyone come across this?

Thanks!

A: 

It could just be a typo, but this looks fishy:

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 ')'
};
karim79
+1  A: 

@Karim79: yes that would screw me up, but that was just me typing into the screen here. It is correct on my code though.

I did figure out the issue. My Coldfusion localhost has internal debugging set to ON. It shows me all the code and processes that ran for the page. I think this extra code spew was making IE barf. So I turned off debugging output and voila. My IE 6 headaches went bye bye :)

Loony2nz
A: 

Thanks Karim, you comment helped me to fix the issue...

A: 

Im using

OnClick="$(\'#test_1\').load( \'../ajax_http.php?variable1=sys&variable2=xload&variable3=string\' );"

Its working under Firefox, Not IE 8. Any ideas??

Zero G
You probably should post this as a new question, not as an answer to an old question. In the upper right there is a "Ask Question" button that allows you to ask a new question.
sth