How to get source code of html page using jquery

Shanzor

New Member
In the android phonegap application i need to get the script of index2.html from index1.html using javascript or jquery.Here is index1.html code:\[code\] function nextpage(){ $.get('index2.html', function(data) { $('#div').html(data); alert('Load was performed.'); }); } <input type="button" value="http://stackoverflow.com/questions/12742534/button1" onclick="nextpage()"/> <div id="div"></div>\[/code\]Here is index2.html code:\[code\]function return1() { alert("welcome to index2.html"); } <input type="button" value="http://stackoverflow.com/questions/12742534/welcome" onclick="return1()"/> \[/code\]From this code i am getting the 'welcome' button from index2.html and appended in #div of index1.html.But i need to append the return1() in #div and need to get the alert("welcome to index2.html").That is html page function response.How to do this.Please help me.Thanks in advance.
 
Back
Top