Skip to content

SunDawning/javascript-http-get

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

一个用JavaScript编写的,用于获取网络资源URI的GET函数,就这样。

https://sundawning.gitee.io/javascript-http-get/

<!doctype html>
<html>
  <head>
    <title>HTTP GET in JavaScript</title>
    <meta charset="utf-8"/>
    <meta http-equiv="Content-Type" name="viewport" content="width=device-width"/>
  </head>
  <body>
    <div style="white-space:pre;font-family:monospace;">
      get({
          url:"https://www.google.com",
          onLoad:function(text){
              document.write(text)},
          hostnamesUseProxy:[
              "google.com"
          ]
      })
    </div>
    <script type="text/javascript" src="./get.js"></script>
    <script type="text/javascript">
      get({
          url:"https://www.google.com",
          onLoad:function(text){
              document.write(text)},
          hostnamesUseProxy:[
              "google.com"
          ]
      })
    </script>
  </body>
</html>