1

I am currently trying to get data from a remote url using jQuery ajax calls.

I am just using a basic jquery function to do this. When using a local file the functions works correctly but it does not get a remote file.

I'm using the local files using Mamp on my local pc.

$.ajax({
url: "URL",
success: function(data) {
    $('#notification').html(data);
}
});

Any ideas why this may not be work would be a great help?

Thanks, Kane

3 Answers 3

4

Sounds like Same origin policy. You might need to use JSONP.

Sign up to request clarification or add additional context in comments.

Comments

1

when you say 'remote file' do you mean like from another domain? coz browsers typically don't allow that.

See this JQuery external Ajax call not working in IE

Comments

1

Cross domain ajax request is not allowed typically. You can take a look to these answers:

jQuery AJAX cross domain

problem with cross-domain ajax calls

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.