Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
32
rated 0 times [  35] [ 3]  / answers: 1 / hits: 35684  / 14 Years ago, tue, january 18, 2011, 12:00:00

I'm trying to get innerHTML of a DIV that is located on external page. It is possible to do this using this kind javascript code?



    <script type=text/javascript>
$(document).ready(function(){
var html = document.getElementById(glr1).src='/my_page.html'.innerHTML ;
alert(html);
});
</script>

More From » jquery

 Answers
117

the jquery load function allows you to specify an element id to load



$('#result').load('ajax/test.html #container');


http://api.jquery.com/load/


[#94160] Monday, January 17, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jeremiahianx

Total Points: 629
Total Questions: 106
Total Answers: 112

Location: Djibouti
Member since Sun, Feb 27, 2022
2 Years ago
;