0

Here I'm trying to access some php page in html page. Both running on different servers one is on WAMP server and I can see the page in browser when I hit

http://localhost:8080/winnersphp/index.php

Now I'm trying to access that page in ajax load like in another html page running in different server (in Eclipse , which is jetty server (java)) in localhost and the page URL is

http://localhost:8888/includephp.html

and in this html page I'm using Jquery

<script>
    $( document ).ready(function() {
    $("#externalHeader").load("http://localhost:8080/winnersphp/index.php");
    });
</script>

But no luck. Is there any security issues ?? or domain issues ??

Initially I thought about some domain issue, but both running on localhost. Port causing any problem here ?

Can some one point me what I'm missing here ?

2
  • Are there any errors in the console? Commented Mar 31, 2014 at 18:43
  • @NateKibler Just cross checked. Nothing. No errors. :-/ Commented Mar 31, 2014 at 18:44

1 Answer 1

1

Looks like jQuery's .load() method is similar to the .get() function, which is subject to the same origin policy. This does, indeed, restrict against different port numbers.

If you can use JSONP, though, you can still accomplish your task by following this answer: https://stackoverflow.com/a/2099771/2482557

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

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.