jQuery.getJSON response not working with IE (works perfectly in firefox,safari...)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

jQuery.getJSON response not working with IE (works perfectly in firefox,safari...)

yabhi

Below is a simple   jQuery.getJSON  call for fetching json data
through jQuery but issue i am facing is that below code works
perfectly fine in firefox,safari but breaks in IE-7.
I have an alert in the call back function for json response which
works in firefox but in IE-7 it does not give any alert.Neither does
it gives any js error.
Seems control isn't coming back to the call back function.
Any help would be highly appreciable, i am using jquery for the first
time and really found it great except this issue .Thanks in advance.
-yabhi


 filter_results : function() {

    // find the active filters
      params = {}
      var self = this;

   //Next four lines simply populate variables i need to send alng
with request which should not be an issue
   this.all_filters.keep(function(jelt){ return
jelt.elt.checked }).each(function(){
      var f = this;
      f.enable();
      params[ f.jelt.attr('group') ] = f.jelt.attr('value');
    })

        // Ajax-request
      var url_json="http://abc.com/im/output_json.php";
      jQuery.getJSON( url_json, params, function(json){
      alert(json.data);
    });
  },




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: jQuery.getJSON response not working with IE (works perfectly in firefox,safari...)

Ben Nevile-2

I too am having problems with getJSON not working for everyone with
IE7.  Call below:


  $.getJSON(
    url,
    function(data){
      create_touch("received entry data");
      $('#loading').hide()
      parse_entry_data(data)
      init_interface()
    }
  )


It works for me with IE7, but not everyone.  It would be great if I
could reproduce, but I can't.  yabhi, maybe you can reproduce?  Try
visiting http://sportsbutter.com -- if the "talking to mothership..."
doesn't disappear for you then maybe we can work on the problem
together.

Ben

Ben



On Sep 16, 11:04 am, yabhi <[hidden email]> wrote:

> Below is a simple   jQuery.getJSON  call for fetching json data
> through jQuery but issue i am facing is that below code works
> perfectly fine in firefox,safari but breaks in IE-7.
> I have an alert in the call back function for json response which
> works in firefox but in IE-7 it does not give any alert.Neither does
> it gives any js error.
> Seems control isn't coming back to the call back function.
> Any help would be highly appreciable, i am using jquery for the first
> time and really found it great except this issue .Thanks in advance.
> -yabhi
>
>  filter_results : function() {
>
>     // find the active filters
>       params = {}
>       var self = this;
>
>    //Next four lines simply populate variables i need to send alng
> with request which should not be an issue
>    this.all_filters.keep(function(jelt){ return
> jelt.elt.checked }).each(function(){
>       var f = this;
>       f.enable();
>       params[ f.jelt.attr('group') ] = f.jelt.attr('value');
>     })
>
>         // Ajax-request
>       var url_json="http://abc.com/im/output_json.php";
>       jQuery.getJSON( url_json, params, function(json){
>       alert(json.data);
>     });
>   },
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: jQuery.getJSON response not working with IE (works perfectly in firefox,safari...)

brian3f
I had the same problem and tracked down the problem to a trailing comma in the JSON data I was returning.  I believe the different IE7 is less forgiving of syntax errors like this.

Hope this helps,

Brian
Ben Nevile-2 wrote
I too am having problems with getJSON not working for everyone with
IE7.  Call below:


  $.getJSON(
    url,
    function(data){
      create_touch("received entry data");
      $('#loading').hide()
      parse_entry_data(data)
      init_interface()
    }
  )


It works for me with IE7, but not everyone.  It would be great if I
could reproduce, but I can't.  yabhi, maybe you can reproduce?  Try
visiting http://sportsbutter.com -- if the "talking to mothership..."
doesn't disappear for you then maybe we can work on the problem
together.

Ben

Ben



On Sep 16, 11:04 am, yabhi <its.abhinav.kati...@gmail.com> wrote:
> Below is a simple   jQuery.getJSON  call for fetching json data
> through jQuery but issue i am facing is that below code works
> perfectly fine in firefox,safari but breaks in IE-7.
> I have an alert in the call back function for json response which
> works in firefox but in IE-7 it does not give any alert.Neither does
> it gives any js error.
> Seems control isn't coming back to the call back function.
> Any help would be highly appreciable, i am using jquery for the first
> time and really found it great except this issue .Thanks in advance.
> -yabhi
>
>  filter_results : function() {
>
>     // find the active filters
>       params = {}
>       var self = this;
>
>    //Next four lines simply populate variables i need to send alng
> with request which should not be an issue
>    this.all_filters.keep(function(jelt){ return
> jelt.elt.checked }).each(function(){
>       var f = this;
>       f.enable();
>       params[ f.jelt.attr('group') ] = f.jelt.attr('value');
>     })
>
>         // Ajax-request
>       var url_json="http://abc.com/im/output_json.php";
>       jQuery.getJSON( url_json, params, function(json){
>       alert(json.data);
>     });
>   },
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: jQuery.getJSON response not working with IE (works perfectly in firefox,safari...)

xohana
In reply to this post by yabhi
After to search for the all forums in the network, i find the solution :

Write the follow line in the code:

jQuery.support.cors = true;

That's all

 
Loading...