开发者

Get HTML source of external webpage

I'm using stuff like document.body.innerHTML but I dont need my page source, I need it to get an external page开发者_如何转开发 source, since

new Ajax.Updater ({success:'employerBox'}, '<%=appRootPath%>/userBoxHome.asp?isEmployer=true&ajaxLogin=home', {evalScripts: true});

Is not working in IE and I need div employerBox to get updated with the content from /userBoxHome.asp?isEmployer=true&ajaxLogin=home

Any suggestions please or any functions that Im missing?

My idea, I know the code is wrong, is to do something like document.body.innerHTML('userBoxHome.asp?isEmployer=true&ajaxLogin=home')


function updateEmployerBox(){
    var div=$('employerBox');
    var url='<%=appRootPath%>/userBoxHome.asp?isEmployer=true&ajaxLogin=home';
    var options = {
        method:'get',
        onSuccess: function(transport){
            div.innerHTML=transport.responseText;
        },
        onFailure: function(transport){
            alert('Failed '+transport.responseText);
        }
    };//end options
    new Ajax.Request(url,options);
}


You might want to check this out:

http://james.padolsey.com/javascript/cross-domain-requests-with-jquery/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜