[jQuery] Re: getJson failing silently

2009-07-10 Thread poluris82
Thank you both, I've learned something new today from each of you. After a number of trials, I think I found the issue. There are some newline characters in some of the rows fetched from the database. I'm almost sure this is what is causing all the issues. I'll see if I can handle them in the ser

[jQuery] Re: getJson failing silently

2009-07-10 Thread Michael Geary
Instead of repeating the object name over and over again, you can simplify the code with an object literal: $.ajax({ type: 'GET', url: 'qtool', processData: true, data: { action: 'executeQuery', entity_name: queryText },

[jQuery] Re: getJson failing silently

2009-07-10 Thread poluris82
yes, I'm using firebug and it's really helpful. That's where I got the sample JSON data (that I gave in my message) from. The response header shows '200 OK' even when the ajax fails. And I see the json data returned in the response. On Jul 10, 11:18 am, MorningZ wrote: > Also i forgot to add: >

[jQuery] Re: getJson failing silently

2009-07-10 Thread MorningZ
That JSON looks fine in JSON Viewer as well (awesome tool if you are on a windows machine: http://www.codeplex.com/JsonViewer) I'd guess that the content type isn't what jQuery is expecting Firebug could/would tell you that "text/plain" or "application/json" is what would be best (and should

[jQuery] Re: getJson failing silently

2009-07-10 Thread poluris82
Thanks MorningZ. I just tried what you said and I got the alert for the responseText, which is basically the sample json data I gave in my listing. That json data looks good to me, but I cant understand why it failed though. Do you see any issues with that data? The json validator on www.jsonlint.

[jQuery] Re: getJson failing silently

2009-07-10 Thread MorningZ
Also i forgot to add: Use Firebug!! it's a HUGE help to help debug AJAX issues

[jQuery] Re: getJson failing silently

2009-07-10 Thread MorningZ
Don't use the $.getJSON method as it, as you are finding out, has no way to handle an error... use the generic $.ajax instead var Params = {}; Params.type = "GET"; Params.url = "qtool"; Params.processData = true; Params.data = {action: "executeQuery", entity_name: queryText }; Params.dataType =