2 Replies - 15079 Views - Last Post: 16 May 2011 - 01:14 PM

#1 rhboarder  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 05-December 09

ajax call not working in chrome, but fine in firefox

Posted 14 May 2011 - 11:43 AM

Don't have a clue as to why this isn't working, possibly something with 1.5.1 version of jquery or how jqXHR works? I'm using firefox v3.6.17 and chrome 11.0.696.57 running on linux. The code below is in an htm file and the json file is in same directory.
res = $.ajax(
{
	url: 'products.json',
	dataType: 'json',
	type: 'GET',
	success: function(data)
	{
		window.alert(data.computers[0].pn);
	}
});
res.error(function()
{
	window.alert("Error!");
});



Is This A Good Question/Topic? 0
  • +

Replies To: ajax call not working in chrome, but fine in firefox

#2 japanir  Icon User is offline

  • jaVanir
  • member icon

Reputation: 1011
  • View blog
  • Posts: 3,025
  • Joined: 20-August 09

Re: ajax call not working in chrome, but fine in firefox

Posted 16 May 2011 - 10:37 AM

Check this page, http://bugs.jquery.com/ticket/5123 it's a bug report about $.ajax not working in chrome and a suggestion for a solution. in short, you should add an empty data var, like:
res = $.ajax(
{
	url: 'products.json',
        data: "", //here
	dataType: 'json',
	type: 'GET',
	success: function(data)
	{
		window.alert(data.computers[0].pn);
	}
});
res.error(function()
{
	window.alert("Error!");
});


Was This Post Helpful? 0
  • +
  • -

#3 rhboarder  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 05-December 09

Re: ajax call not working in chrome, but fine in firefox

Posted 16 May 2011 - 01:14 PM

I had run into that page before and tried it, didn't help unfortunately :( Any other suggestions?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1