Im developing my senior project . I'm using cordova to develop a mobile application on android. language im useing, html5, js, xml, css, jquery, jquery mobile.
im getting: XMLHttpRequest cannot load http://thegamesdb.net/api/GetGamesList.php?name=zelda. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'ttp://localhost:8383' is therefore not allowed access.
Note: I cant afford to rent a server to run php code on it
in html page
$(document).on("pagebeforeshow", "#addGamePageOne", function (){ document.getElementById("gameInfo").innerHTML=""; $("#searchGame").click(function(search){ search.preventDefault(); document.getElementById("results").innerHTML="searching"; xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { searchGame(xmlhttp); } }; xmlhttp.open("GET", "http://thegamesdb.net/api/GetGamesList.php name="+$("#gameName").val(), true); xmlhttp.send(); }); });
No comments:
Post a Comment