문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top