Get HTML code using JavaScript with a URL

前端 未结 5 1354
鱼传尺愫
鱼传尺愫 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:59

    There is a tutorial on how to use Ajax here: https://www.w3schools.com/xml/ajax_intro.asp

    This is an example code taken from that tutorial:

    
    
    
        
    
    
    
        

    Let AJAX change this text

提交回复
热议问题