php - Get page source of external URL and manipulate with javascript/jquery -



php - Get page source of external URL and manipulate with javascript/jquery -

i'd somehow page source of external url, , that, able contents of h1 element.

for example, logic:

var url = "http://example.com"; var src = // page src of url // instead of document, utilize variable src var headertext = document.getelementsbytagname("h1")[0].innerhtml; alert(headertext);

i know can stuff curl/php, have heard larger sites cause server strain. i'd prefer maintain efficient possible. not sure start.

this cannot done, by policy.

in web pages, javascript (and client-side scripts in general) aren't allowed access raw external resources different domain, in general.

the closest you're going using ajax (jquery helps) access resource, (in general) need requesting url under same domain.

javascript php jquery curl

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -