解决方案 »
- 超级着急!大神,怎么把这段json用js循环取生成带有链接的children子项html效果(如json数据下面)
- 如何实现点击表格行显示提示?
- 为什么getElementById找不到控件呀
- jquery.datalink 具体怎么用?
- JavaScript怎么得到 下拉列表框的值?
- 怎样在关闭当前框架网页之后跳转或打开另外一个网页
- 怎么实现预览功能?
- 打开新窗口并改变其大小、位置的语句,在IE5正常,在IE6下就不行,为啥
- ExtJS怎么把后读取的JSON数据添加到先生成的GridPanel的Store中?
- jqmobi 与 jquery 不兼容
- 关于jQuery的ajax调试问题
- 正则表达式问题
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script>
<script>
// jquery.xdomainajax.js ------ from padolseyjQuery.ajax = (function(_ajax){ var protocol = location.protocol,
hostname = location.hostname,
exRegex = RegExp(protocol + '//' + hostname),
YQL = 'http' + (/^https/.test(protocol)?'s':'') + '://query.yahooapis.com/v1/public/yql?callback=?',
query = 'select * from html where url="{URL}" and xpath="*"'; function isExternal(url) {
return !exRegex.test(url) && /:\/\//.test(url);
} return function(o) { var url = o.url; if ( /get/i.test(o.type) && !/json/i.test(o.dataType) && isExternal(url) ) { // Manipulate options so that JSONP-x request is made to YQL o.url = YQL;
o.dataType = 'json'; o.data = {
q: query.replace(
'{URL}',
url + (o.data ?
(/\?/.test(url) ? '&' : '?') + jQuery.param(o.data)
: '')
),
format: 'xml'
}; // Since it's a JSONP request
// complete === success
if (!o.success && o.complete) {
o.success = o.complete;
delete o.complete;
} o.success = (function(_success){
return function(data) { if (_success) {
// Fake XHR callback.
_success.call(this, {
responseText: data.results[0]
// YQL screws with <script>s
// Get rid of them
//.replace(/<script[^>]+?\/>|<script(.|\s)*?\/script>/gi, '')
}, 'success');
} };
})(o.success); } return _ajax.apply(this, arguments); };})(jQuery.ajax);$.ajax({
url: 'http://www.biquge.com/0_360/157267.html',
type: 'GET',
success: function(res) {
var text = res.responseText;
// then you can manipulate your text as you wish
alert(text);
}
});
</script>
</head>
<body>
</body>
</html>