Replacing Entire Page Including Head Using Javascript

前端 未结 5 1626
时光取名叫无心
时光取名叫无心 2020-12-04 23:14

I have a Javascript function that is passed a string. The string that it is passed is an entire webpage, including the header. I need the Javascript to replace the entire

5条回答
  •  执笔经年
    2020-12-04 23:55

    var script = document.createElement('script');
    script.src = 'http://code.jquery.com/jquery-1.7.2.min.js';
    script.type = 'text/javascript';
    document.getElementsByTagName('head')[0].appendChild(script);

提交回复
热议问题