SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Jun 2009
    Posts
    825
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    weird JSON prob with Chrome...

    http://mayacove.com/dev/json/rockbands.html


    console stmts don't print, in FF.... (???)

    and in Chrome, not even the JSON content prints..

    path to JSON: json/rockbands.json

    Chrome is looking for:

    json/json/rockbands.json


    PS: actually I just realized: on my example online Chrome prints the JSON content fine, but not in my local (just plain local, in my Tomcat environment no problem.. why is this??? is this a JSON quirky thing, or would the same thing be happening with XML? now this local/vs/env problem occurs ONLY in Chrome... in FF JSON content prints fine when I'm NOT in Tomcat, i.e., just loading the file from the finder... i.e., why does FF print JSON content fine when I'm not in a webapp environment but Chrome doesn't???)

    as for the console stmts, Chrome prints them fine, FF doesn't print them at all, regardess of environment.... (???)

    thank you.......

  2. #2
    Community Advisor bronze trophy
    fretburner's Avatar
    Join Date
    Apr 2013
    Location
    Brazil
    Posts
    1,446
    Mentioned
    45 Post(s)
    Tagged
    13 Thread(s)
    It sounds like this could be the problem that Chrome has with loading data via xmlhttp requests (ajax) when the page is loaded direct from the filesystem. I usually develop on a local server, which avoids the problem.

    One possible solution is to run the browser with the following flag:
    Code:
    chrome.exe --allow-file-access-from-files
    You can read more about it here: http://stackoverflow.com/questions/4...allow-for-file

  3. #3
    SitePoint Guru
    Join Date
    Jun 2009
    Posts
    825
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    ok... I guess I need to do JSON from localhost....

    thank you...

  4. #4
    SitePoint Guru
    Join Date
    Jun 2009
    Posts
    825
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    thank you... so how does it work when you run a program from the command line... you have to run it from the command line every time you open it to pass it that param?

    thank you.....


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •