<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<input type="text" style="width:600px;height:30px;font-size:14px;" id="urlText" value="https://www.baidu.com" />
<input type="button" value="获取" onclick="getURL1()" />
<br />
<div id="msg2"></div>
<script src="https://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
function getURL1() {
$("#msg2").html("");
var url = $("#urlText").val();
$.ajax({
type: 'get',
url: url,
cache: false,
dataType: "jsonp",
jsonp: "callback",
processData: false,
timeout:10000,
complete: function (data) {
console.log(data);
}
});
}
</script>
</body>
</html>
效果类似如上