Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
151
rated 0 times [  153] [ 2]  / answers: 1 / hits: 116430  / 10 Years ago, fri, september 26, 2014, 12:00:00

I would like to retrieve the following sites body content http://sports.espn.go.com/nhl/bottomline/scores?nhl_s_left1 and store it in a string, i know and am successful at retrieving this using php, however i want to restrict to using only javascript, is there a way just to take the string in the site and copy it and store it in a var?


More From » javascript

 Answers
30

Although the @Brendan's answer is accepted and correct.



It is simple, short and faster enough to get a body element using



document.body;


It does the same as we can do with document.getElementsByTagName('body')[0];, and it should be in the list of answers.


[#69317] Wednesday, September 24, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
andreguym

Total Points: 125
Total Questions: 112
Total Answers: 103

Location: Wallis and Futuna
Member since Tue, Mar 30, 2021
3 Years ago
;