非得用getJSON么,如果只是为了拿到responseText的值而已可以用$.get[JavaScript] 纯文本查看 复制代码 $.get("www.baidu.com",function(res){
console.log(res)
})
值为:
[Asm] 纯文本查看 复制代码 01.html:13 <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<p style="width: 100%;text-align: center;font-size: 140px;height: 40px;">404</p>
<p style="width: 100%;text-align: center;font-size: 40px;">Page Not Found</p>
<!-- p style="width: 100%;text-align: center;font-size: 18px;">访问<a target="_blank">DCloud官网</a>或<a target="_blank">社区</a></p> -->
<script>document.write('<script src="//' + (location.host || 'localhost').split(':')[0] + ':35929/livereload.js?snipver=1"></' + 'script>')</script><script>document.addEventListener('LiveReloadDisconnect', function() { setTimeout(function() { window.location.reload(); }, 500); })</script></body>
</html> |