Closed GoogleCodeExporter closed 8 years ago
Hi,
Could you confirm that JSON file is loaded via AJAX call (you can trace it in
the FireBug Net panel)? Maybe JavaScript source file is not mapped correctly.
If list.js file is loaded could you check what is a content type of the
response? There is a problem with local computers because sometimes it is
returned as "text/javascript" and plugin does not recognize it as a JSON object
so the load fails.
If you open online list you will see that Content-Type of list.js file is
"application/json" (this is set online using the svn-mime-type:application/json
- without this it would not work.
I see that you are using IIS so if you are C# developer and use ASP.NET MVC you
can download functional example from the code project article
http://www.codeproject.com/KB/aspnet/JavaScript-View-Engine.aspx - there you
can find ASP.NET MVC application that works with loadJSON plugin. In this
example I have returned application/json response using the following code:
public ActionResult List()
{
return Json(DataRepository.GetCompanies(), JsonRequestBehavior.AllowGet);
}
If you can create some ASP.NET application could you try to replace list.js
with something like a list.aspx where you will write in the response JSON
object form the list.js file and explicit set response.contenttype to the
application/json.
Original comment by joc...@gmail.com
on 4 May 2011 at 8:14
[deleted comment]
thx
Original comment by hunter...@gmail.com
on 6 May 2011 at 8:04
Hi, could you take a version 1.2 from the
http://code.google.com/p/jquery-load-json/source/browse/trunk/scripts/jquery.loa
dJSON.js? In this version I have added parseJSON function that tries to parse
string so if your mime-type is not correct it should work. I have tried it and
it works on my local computer.
Let me know is this version resolved your problem with loading.
Thanks,
Jovan
Original comment by joc...@gmail.com
on 7 May 2011 at 9:39
[deleted comment]
version 1.2 works fine on my local site.(IE and Chrome)
Original comment by hunter...@gmail.com
on 7 May 2011 at 12:29
Problem is fixed in the version 1.2. I'm closing this issue.
Original comment by joc...@gmail.com
on 7 May 2011 at 12:42
Original issue reported on code.google.com by
hunter...@gmail.com
on 30 Apr 2011 at 2:34