1

I don't have much experience with coding and m stuck with my project. PLEASE HELP!!

I am developing Buyers Guide app with Phonegap. I am using ebay api to fetch product info. Its php code is working on browser with apache server. But when i tried to load and run it on simulator, it didnt worked. (this is d page which opens after clicking "Search product" hyperlink)

<!DOCTYPE html>
<html>
<head>
<script src="jquery-1.9.1.js">
</script>
<script>
$(document).ready(function(){
  $("button").click(function(){
    $('#div1').load('http://localhost/MySample.php');
  });
});
</script>
</head>
<body>

<div id="div1"><h2>Click to get information</h2></div>
<button>Get External Content</button>

</body>
</html>

How Can i access data from server then? Do i need to create web service?If yes then which approch should I use?or Ajax would work? i havnt used anything among these approches before and googling this is creating so much confusion. so plz suggest simpler one.

Thanking You in Advance.

1 Answer 1

1

the call $('#div1').load('http://localhost/MySample.php'); is not okay, because you should call another machine. localhost it the same machine- in your case it is phone.

Try to provide you server IP address where MySample.php script is placed

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.