Get HTML code using JavaScript with a URL

前端 未结 5 1353
鱼传尺愫
鱼传尺愫 2020-12-01 14:31

I am trying to get the source code of HTML by using an XMLHttpRequest with a URL. How can I do that?

I am new to programming and I am not too sure how can I do it wit

5条回答
  •  攒了一身酷
    2020-12-01 14:51

    For an external (cross-site) solution, you can use: Get contents of a link tag with JavaScript - not CSS

    It uses $.ajax() function, so it includes jquery.

提交回复
热议问题