Note that there are some explanatory texts on larger screens.

plurals
  1. POPhonegap parse external HTML
    primarykey
    data
    text
    <p>I'm wrinting on a PhoneGap app that has the HTML and Javascript for the Navigation local and it should load the contend from the Web.</p> <p>I don't have direct controll over the content Server so I can't change anything there.</p> <p>The Content i want to get in to my app is based on a normal HTML website so i want to get for example the Text in da div or so.</p> <p>What i have so far:</p> <pre><code>&lt;script type="text/javascript"&gt; var url = "http://example.org/" updateGadget(); inervalID = setInterval("updateGadget();", 60 * 1000); function updateGadget() { $(document).ready(function () { $.ajax(url, {}, function (response, status, xml) { console.log(response); }); }); } &lt;/script&gt; </code></pre> <p>The Problem is thad it doesn't work, it shows me nothing.</p> <p>For developing is use a Webserver not directly PhoneGap. When i open the Website in Google Chrome it shows the error:</p> <pre><code>XMLHttpRequest cannot load http://example.org Origin http://example.org is not allowed by Access-Control-Allow-Origin. </code></pre> <p>in the Console.</p> <p>I found the i should use this header:</p> <pre><code>header('Access-Control-Allow-Origin: *'); </code></pre> <p>Where should i use it, if i put it in my HTML (PHP) file to the Top it does nothing an on the Server i want to Parse I cant put it.</p> <p>Where is the Problem, and how can if fix thad? Or is there a better Way to do this? If possible i want to di it directly on the PhoneGap app without a secound server backend.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload