I am trying to get the source code of html by using a xmlhttprequest with a url. Is there anyone who can help me with this? I am new to programming and I am not too sure how can I do it without jQuery. Thanks in advance.
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- Carriage Return (ASCII chr 13) is missing from tex
- void before promise syntax
Use jQuery:
This data is your HTML.
Without jQuery (just JS):
There is a tutorial on how to use ajax here: http://www.w3schools.com/ajax/default.asp
This is an example code taken from that tutorial:
For external (cross-site) solution, you can use: https://stackoverflow.com/a/18447625/2657601
It uses
$.ajax()
function, so it includes google jquery.