本帖最后由 huangwanfeng9 于 2014-03-09 10:20:11 编辑

解决方案 »

  1.   

    httpRead("http://www.biquge.com/0_360/157267.html");这里怎么用的静态的网页,静态网页可以作为ajax请求的目标吗?这个我还真是不清楚,但是按我的想法,应该不行吧。还有一个可能的问题,就是跨域问题了,你的发出请求的页面,是不是在www.biquge.com这个域名下。
      

  2.   

    前台搞不了,浏览器的javascript搞不了
      

  3.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <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>