When a link to a page is specified (eg:var page = "https://myPAge.php"
) is it possible, to iterate through the DOM elements by using functions such as getElementsByID("myid")
?
Asked
Active
Viewed 47 times
0

Amy Cohen
- 109
- 12
-
1Depends on the environment. In Node.js, maybe. In the browser, no. – Felix Kling Dec 04 '16 at 05:40
-
1Possible but not easy. Use Ajax to get response. Convert the response to HTML and use Javascript to add the HTML to your current page, mark it hidden. Then use document.getElementById – Rehban Khatri Dec 04 '16 at 05:44
-
Is this different page on the same site? Is it on a server you control? – melpomene Dec 04 '16 at 05:46
-
@melpomene No it's a completely external page. – Amy Cohen Dec 04 '16 at 05:48
-
1@AmyCohen Then you can't even fetch that page (assuming normal JavaScript on a website), let alone parse it. – melpomene Dec 04 '16 at 05:49