Hi, I want to get a webpage's HTML.
I tried with AJAX Request URL (webpage's URL) and then get the page's HTML from AJAX.LastData. My problem is it does not always work, for example, it does work with
AJAX Request: "http://www.nationalgeographic.com/"[/code:3640r9pw] but it does not work with [code:3640r9pw]AJAX Request: "http://www.scirra.com/"[/code:3640r9pw] Anyone got a clue?
It's because that's what they've set on their servers.
"No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'yourIP:50000' is therefore not allowed access."
If you set "Preview browser" to "NW.js", it will work because it will run as an app locally. Similar story will be present when exporting – I'm pretty sure if you export to HTML5 and upload to your server, it won't work. However, NW.js and Androdid export should work.
When previewing in Chrome, there is one trick you could try – disabling this warning. Make sure only to use this when testing, not when browsing normally, because it could potentially be dangerous.
If you open cmd at the install directory of Chrome and type in the following code, Chrome will open with the warning disabled:
chrome.exe --disable-web-security --user-data-dir[/code:3640r9pw]
(make sure you close all Chrome instances before that)
After you're done with testing, closing all Chrome instances will revert Chrome back to normal mode.