cementedmind / jquery-load-json

Automatically exported from code.google.com/p/jquery-load-json
0 stars 0 forks source link

The list.html doesn't work well on my computer? #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I downloaded all the project files(include sub folders and files) to my 
folder named "demo"
2. Set "demo" webshare name "loadjson"(I have IIS installed on my computer)
3. In my browser(chrome), "http://localhost/loadjson/list.html" doesn't load 
JSON object into the DOM. 

What is the expected output? What do you see instead?
http://jquery-load-json.googlecode.com/svn/trunk/list.html    works fine.
http://localhost/loadjson/list.html  doesn't work well.

What version of the product are you using? On what operating system?
jquery.loadJSON.js 
Version:     1.1.0.

Please provide any additional information below.

Original issue reported on code.google.com by hunter...@gmail.com on 30 Apr 2011 at 2:34

GoogleCodeExporter commented 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

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
thx

Original comment by hunter...@gmail.com on 6 May 2011 at 8:04

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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