Getting No 'Access-Control-Allow-Origin' header is present on the requested resource

  • 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 No ‘Access-Control-Allow-Origin’
    header is present on the requested resource. Origin ’http://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 (){
    xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = function() {
    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
    };“GET”, ""+$("#gameName").val(), true);

  • All of the urls are accessible via browser. So if you paste your generated URL into a browser and dont see anything, either the site is down or youve generated an invalid URL.

    If the browser version works, then something is obviously wrong with your code. Test it using a different URL independent of the gamesdb