Loading ...
Sorry, an error occurred while loading the content.
 

Re: [json] JSON and Firefox Javascript Console

Expand Messages
  • Mike D
    well, here s the line that grabs the json string: var jsonObj = JSON.parse(http.responseText); fyi: Im using the JSON Parser from json.org Do you think I/we
    Message 1 of 8 , Jan 28, 2006
      well, here's the line that grabs the json string:
      var jsonObj = JSON.parse(http.responseText);

      fyi: Im using the JSON Parser from json.org

      Do you think I/we should consider this an FF issue since the errors doesn't show up on IE and Opera and it is functioning pretty well? I was just concerned that there might be something wrong with my json string.

      Thanks

      Michal Migurski <mike-jsonphp@...> wrote: > I'm trying out JSON and I find it really easy to produce and
      > manipulate. But I have some concerns regarding FireFox's Javascript
      > Console. I'm using 1.5 btw, PHP-JSON and json.js from json.org.
      >
      > Everytime I try to pass back a json string from a PHP script using
      > "echo", I always get an error message on FFox's Javascript Console.

      The JSON string looks fine. Could it be that you are just evaluating
      it directly in the browser, without adding any context such as "var
      foo = [...];" ?

      ----------------------------------------------------------------
      michal migurski- contact info and pgp key:
      sf/ca http://mike.teczno.com/contact.html





      SPONSORED LINKS
      Json Programming languages Format Computer security Computer training Large format

      ---------------------------------
      YAHOO! GROUPS LINKS


      Visit your group "json" on the web.

      To unsubscribe from this group, send an email to:
      json-unsubscribe@yahoogroups.com

      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


      ---------------------------------





      Send instant messages to your online friends http://uk.messenger.yahoo.com

      [Non-text portions of this message have been removed]
    • Jim Washington
      ... What content-type are you sending with your JSON? Is there a charset involved? I ve found that similar I can t parse this issues are sometimes resolved
      Message 2 of 8 , Jan 28, 2006
        Mike D wrote:

        >well, here's the line that grabs the json string:
        >var jsonObj = JSON.parse(http.responseText);
        >
        >fyi: Im using the JSON Parser from json.org
        >
        >Do you think I/we should consider this an FF issue since the errors doesn't show up on IE and Opera and it is functioning pretty well? I was just concerned that there might be something wrong with my json string.
        >
        >
        What content-type are you sending with your JSON? Is there a charset
        involved?

        I've found that similar "I can't parse this" issues are sometimes
        resolved if you use "application/x-javascript" for content-type.

        Worth a try, at least.

        -Jim Washington
      • Mike D
        lol I give up. I tried using several charsets along with text/plain, text/javascript, application/x-javascript, application/javascript and
        Message 3 of 8 , Jan 28, 2006
          lol I give up. I tried using several charsets along with text/plain, text/javascript, application/x-javascript, application/javascript and application/x-_javascript but the error is still there.

          The JSON object gets parsed perfectly though. I just hate seeing these errors on my JS Console everytime I test the page.

          Thanks

          Jim Washington <jwashin@...> wrote: Mike D wrote:

          >well, here's the line that grabs the json string:
          >var jsonObj = JSON.parse(http.responseText);
          >
          >fyi: Im using the JSON Parser from json.org
          >
          >Do you think I/we should consider this an FF issue since the errors doesn't show up on IE and Opera and it is functioning pretty well? I was just concerned that there might be something wrong with my json string.
          >
          >
          What content-type are you sending with your JSON? Is there a charset
          involved?

          I've found that similar "I can't parse this" issues are sometimes
          resolved if you use "application/x-javascript" for content-type.

          Worth a try, at least.

          -Jim Washington


          ---------------------------------
          YAHOO! GROUPS LINKS


          Visit your group "json" on the web.

          To unsubscribe from this group, send an email to:
          json-unsubscribe@yahoogroups.com

          Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


          ---------------------------------





          Send instant messages to your online friends http://uk.messenger.yahoo.com

          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.