3
3
3ds2011-09-02 10:10:31
JSON
3ds, 2011-09-02 10:10:31

Ask for help $.getJSON

Hello, please tell me where to dig, otherwise I have run out of ideas ...
There is a test site bestmedia.gdeomsk.ru. When you visit the link bestmedia.gdeomsk.ru/clients we see a list of clients. When you click on a client, json is loaded
$.getJSON("/clients/get_works/" + clientId + '?rnd=' + Math.random(), function(json){ .. }
. In normal browsers, everything is OK - a list of jobs falls out (when viewing, please note that jobs are not set for all clients yet). In IE… it's just silent and that's it.
I installed blackbird for debugging and IEWatch. IEWatch shows that the request is coming, but no errors are thrown and it is not included in the function (exit handler).
Code below:

  1.     $.ajaxSetup({ cache: false });
  2.     log.info('cache cleared');
  3.     $.getJSON("/clients/get_works/" + clientId + '?rnd=' + Math.random(), function(json){
  4.       log.info('getJSON in');
  5.       // other code here....
  6.     });
* This source code was highlighted with Source Code Highlighter.

By pressing f2, you can open blackbird and see that it does not issue "getJSON in" breaks after clearing the cache in IE ... Tell me what could be the problem?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
3
3ds, 2011-09-02
@3ds

Bliiin jamb was here in what. When uploading, Python set: but it was necessary to specify the utf-8 encoding through "-" Like this ...
return HttpResponse(
       js,
       content_type = 'application/json; charset=utf8')

return HttpResponse(
        js,
        content_type = 'application/json; charset=utf-8')

I
Ilya Plotnikov, 2011-09-02
@ilyaplot

And in what ie problems? Everything works for me in version 9.

P
pratamishus, 2011-09-02
@pratamishus

Here's what I noticed when testing in IE6. When launched for the first time, it does not work (which is identical to clearing the cache). At the first load, it gives such an error "undefined" is null or not an object (line 477 symbol 2). Unfortunately, due to the poor debugger of IE6, it is difficult to detect a bug without code. Nevertheless, I can tell you what to do:
Apparently, somewhere in your code (perhaps even before calling JSon), an object or variable is called that is not set anywhere. In this case, IE terminates all subsequent scripts. In this case, I always use half debugging (I warn you - a black way, but it always works), that is,
first put a javascript alert after the first call to javascript. If the alert passed, insert it after the next one, etc. until the alert stops being displayed - this way you will find the error in which script.
Then insert the alert in the middle of the script - if it is shown, move it to the middle of the second half, otherwise to the middle of the first half, etc.
Once again - the way is black, but sometimes it is simply impossible in another way, especially with IE

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question