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 6976101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:27:13+00:00 2026-05-27T17:27:13+00:00

I am an absolute beginner to jQuery and json, and I am trying to

  • 0

I am an absolute beginner to jQuery and json, and I am trying to parse a json object using jquery. The json object is

{"interested":1,"like":3,"dislike":2}

The code I am using to parse the json object is

$.getJSON( "get_reviews.php?mid=x&uid=0",
function (data)
{
    console.log("parsing");
    Interested = data.interested;
    Dislike = data.dislike;
    Like = data.like;
    }

The error I’m getting is

XMLHttpRequest cannot load http://www.********.***/get_reviews.php?mid=x&uid=0. Origin http://********.*** is not allowed by Access-Control-Allow-Origin.

Anyone knows where I’m going wrong? I’ve tried fixing it in several ways (using different examples for AJAX requests).

—-Edit—-
Despite not accessing any cross-domain file, I took the suggestion from this question:

XMLHttpRequest cannot load an URL with jQuery

And added “&callback=?” to my code url, which got rid of the error mentioned above but now gives another error

Uncaught SyntaxError: Unexpected token :

Since there’s only one line, it seems to refer to the colon in the json object, which seems extremely odd. Any idea why this might be happening.

PS: I also took user1105704’s suggestion below with the ajax method (I’d tried this before) except making the dataType “jsonp”, and it reproduces the error regarding the Unexpected token

  • 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-27T17:27:14+00:00Added an answer on May 27, 2026 at 5:27 pm

    looks like I was making a much smaller error than I realised. The URL I gave was a complete URL (http://www.*.*/get_reviews.php).

    It turns out that’s the reason it was being considered a cross-domain access. As soon as I switched it to a file location (location from root, so if file is in folder a, then a/get_reviews.php), it worked like a charm.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm an absolute beginner using Joomla. I'm trying to load a module within another
Absolute beginner question: I have a template file index.html that looks like this: ...
I'm an absolute beginner, you see. Say I have a string object on the
I'm an absolute beginner when it comes to using both SWIG and lua, and
This is an absolute beginner question in TFS SDK: I am trying to connect
I'm an absolute beginner using IDLE (Python 2.6.4) to learn the basics. I recently
I am absolute beginner to drupal. I have added a contact form (using Webform
Hi I am a beginner jQuery user and I am trying to create a
I am an absolute beginner in this field. I have written the following code
I am an absolute beginner. Never made a classifier or anything in weka using

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.