Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6807487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:50:18+00:00 2026-05-26T19:50:18+00:00

When I use JSON.parse(jsonString), the JSON is parsed no problem at all. var result

  • 0

When I use JSON.parse(jsonString), the JSON is parsed no problem at all.

var result = JSON.parse(jsonString);

But when I use jQuery.getJSON(jsonString) i received an http error 403.

var result = jQuery.getJSON(jsonString);

Any idea why one will work and the other will not? They are both reading a string.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:50:19+00:00Added an answer on May 26, 2026 at 7:50 pm

    They are both reading a string.

    Oh no! Those two methods are so very much different. They have absolutely nothing in common. They are accomplishing 2 entirely different tasks.

    The first simply parses a JSON string into a javascript object:

    var result = JSON.parse('{"foo": "bar"}');
    alert(result.foo);
    

    will show bar. Also notice that the JSON.parse method is a built-in method in modern browsers. It’s pure javascript and has strictly nothing to do with jQuery. Legacy browsers do not support it. For them you need to include the json2.js script to your page.

    The second performs an AJAX call and expects as argument an url:

    jQuery.getJSON('/someserversidescript', function(result) {
        // callback to be executed when the AJAX request succeeds
    });
    

    As you can see here the argument is an url. Calling jQuery.getJSON('{"foo": "bar"}') makes strictly no sense. I guess that’s the reason why your server responds with 403 error, since this is not valid url on your server. It expects that the server will return a JSON string as response. It’s simply a shorthand for:

    $.ajax({
        url: '/someserversidescript',
        type: 'GET',
        dataType: 'json',
        success: function(result) {
            // callback to be executed when the AJAX request succeeds
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If you do this... var parsed = JSON.parse('{myNum:0.0}') ; Then when you look at
I have the following JSON String. var jsonString = '{J:4,0:M, J:5,0:N}' If I parse
I am getting a use of undeclared identifier error in my json but I
I use json data with jquery... I have filepaths in json and i am
I know how to use JSON to create objects, but there doesn't seem to
I usually use JSON with jQuery to just return a string with html. However,
I have json string from here: http://vkontakte.ru/al_video.php?act=load_videos_silent&al=1&oid=8046830 I use Touch json parser. //received json
I'm interperting a json string into a variable using jquery's parseJSON() function. The problem
I've googled around, but i can find a way to build json with jQuery
Why should I use JSON with ASP.NET? Can you give a practical example? I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.