Use XMLHttpRequest to read the page's data (or use $.Ajax) and then use the innerHTML property to set it as the div's content.
Chrome app - load external content into div
-
20-06-2023 - |
Question
I am writing a chrome app and I need to load the content of an online page into a div to use it.
Usually I use this code in online or local server but this doesn't work in app:
Jquery:
var contentURI= 'your-url #element';
$('#response').load('grab.php?
url='+ contentURI);
grab.php
<php echo file_get_contents
($_GET['url']); ?>
I also set the url of the site to load in permissions..
What can I do? Thanks
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow