views:

523

answers:

3

hey i have problem with jQuery-ui Dialog when using ajax

$.ajax({ 
                        url: "folders.php", 
                        cache: false,
                        data: {
                                'do' : 'Ajax'
                                ,'_a' : 'ChangeMoviesFolder'
                                ,'MovieIDS' : MovieIDS
                                ,'toFolderID' : toFolderID
                                ,'fromFolderID' : fromFolderID
                        },
                        context: document.body, 
                        open: function(event, ui) {

                            alert('open');
                        },
                        error : function(XMLHttpRequest, textStatus, errorThrown){
                             // Handle the beforeSend event
//                          alert("responseText: "+errorThrown.message);

                           },

                        success: function(data){
                            $('input.checkMovie').attr('checked',0);
                                $("#resultsTable").find('tr.selectable-row').removeClass('active');


                            if (data == '1')
                            {

                                window.location = WWW_ROOT+'movies.php?do=List&FolderID='+toFolderID;
                            }
                             $dialog.dialog("close"); 
                      }});

when using IE ajax never get to success option in error i got

"This method cannot be called until the open method has been called"

Its happen only in IE.

Does any one may know what the problem might be ?

(all vars are ok and works perfectly in FF & chrome)

thanks.

A: 

Have you tried to us the Developer tools in IE to step through your code and see what is getting executed and what the variable values are? IE 8 has a great set of tools built right in by hitting F12.

Working with the Internet Explorer Developer Tools

Chris Love
yes i have tried , no error using IE , all params working and have values , the only problem is using $.ajax inside a dialog box
A: 

after alot of checking ajax not working at all with IE

i tried

$.ajax({ url: 'movies.php', data: "do=UpdateMovies&_a=SetStatus", success: function(data){ alert('something');

  }});

inside a function , no vars , i have tried it just like in

http://api.jquery.com/jQuery.ajax/

and its just dont get executed any help will be appricated

I have posting lately about jQuery, JSON and WCF web services lately. Maybe you can review some of the code I am using to see if it will work for you. I use IE all the time and have no jQuery ajax issues. http://professionalaspnet.com/archive/tags/WCF/default.aspx
Chris Love
+3  A: 

There's a conflict between jQuery 1.4 and Sarissa.

Is sarissa.js included on the page?

Similar reports:

https://jira.jboss.org/jira/browse/RF-8282

http://code.google.com/p/google-web-toolkit/issues/detail?id=3608

http://code.google.com/p/jstree/issues/detail?id=430

This change to Sarissa seems to work.

// _SARISSA_XMLHTTP_PROGID = Sarissa.pickRecentProgID(["Msxml2.XMLHTTP.6.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"]);
 _SARISSA_XMLHTTP_PROGID = Sarissa.pickRecentProgID(["MSXML2.XMLHTTP", "Microsoft.XMLHTTP"]); 
Doug D
Thanks. That fixed it for me.
Charles Anderson
Worked for me and saved my website launch (after we ported to jQuery from Prototype the day before going live!). Thanks a million.
xan
I had seen those links, but didn't put together the common thread. Thank you so much.
attack