SideDishStudio
SideDishStudio

Reputation: 705

Using $.get() to retrieve all content from another webpage

I'm using $.get() to retrieve content from another webpage so I can parse specific elements. My question is, does the browser run the javascript on the target page? All signs point to no for me (which is what I want), but I'm afraid I'm missing something...

Upvotes: 0

Views: 55

Answers (1)

thetrompf
thetrompf

Reputation: 460

Actually the webpage you're 'getting' a page from a different domain than your own page is hosted from, the 'other' page has to allow this, with passing allow-origin headers.

To answer you question, when you are using ajax call to retrieve data with, the browser does not run the data, it's simply just data, you have to add the scripts tags from the site you are requesting to your own DOM in order to run the other site's javascript.

Upvotes: 1

Related Questions