0

Say a website exists with the following content.

<html><wrapper><div>Stuff I care about</div>Stuff I don't care about</wrapper></html>

Is it possible to load the website with javascript but also modify the content. So in this case I want to use Javascript to load the Stuff I care about, but hide everything else.(Kind of like an iframe... with benefits).

Note: To give you some context I'm trying to make an app that creates my own custom version of another persons website. What makes this really difficult is part of the content I want to show is a form with a captcha.

Philip Kirkbride
  • 21,381
  • 38
  • 125
  • 225

2 Answers2

0

You can selectively load content from a url into another element as follows, though I'm not sure about cross-domain issues:

$('target').load('http://www.example.com/index.html wrapper div');

Note that the part after the url ("wrapper div") is just a jQuery selector.

Also note that comments are right about the cross-domain issue. You'd either have to proxy www.example.com or use YQL (which I'm not familiar with).

Community
  • 1
  • 1
Grimace of Despair
  • 3,436
  • 26
  • 38
0

You'll need to request and download the page using your server, then send it back to the client with AJAX.

Jared
  • 2,978
  • 4
  • 26
  • 45