Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
<div id="jdj">sdsfs dgsdfffffffffffffffffs</div>
<script type="text/javascript">
$.getJSON("http://webdev.student.uws.ac.uk/movie-trivia.php", function (data) {
document.getElementById("jdj").innerText = data;
alert(data);
});
</script>
I got this from a website but it didn't work. I'm I getting something wrong.
Posted
Updated 22-Mar-14 18:20pm
v2
Comments
Peter Leow 23-Mar-14 2:55am    
'something wrong' is not informative. You are using jquery, did you include a jquery library in your web page? the problem could also lie with the php script.

1 solution

you can try using $.ajax()

$.ajax({
       data:formData,
       url: 'http://XXXXXXXXXXXXXXXXXXX/test_client.php',
       dataType: "jsonp",
       jsonpCallback: "onSuccess"
   });
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900