2011-10-20 6 views
0

JavaScriptを使用してこのURLからRSSを読み取ろうとしています。http://www.vworker.com/RentACoder/misc/LinkToUs/RssFeed_newBidRequests.asp?blnAllOpen=true私はそれを行うXMLHttpReqしようとしているが、動作していない。JavaScriptを使用したRSSからのXMLの読み取り

url="http://www.vWorker.com/RentACoder/misc/LinkToUs/RssFeed_newBidRequests.asp?blnAllOpen=true"; 
    var xmlhttp = null; 
    if (window.XMLHttpRequest) 
    { 
     xmlhttp = new XMLHttpRequest(); 
     if (typeof xmlhttp.overrideMimeType != 'undefined') 
     { 
     xmlhttp.overrideMimeType('text/xml'); 
     } 
    } 
    else if (window.ActiveXObject) 
    { 
     xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
    } 
    else 
    { 
     alert('Perhaps your browser does not support xmlhttprequests?'); 
    } 

    xmlhttp.open('GET', url, true); 
    xmlhttp.send(null); 
    xmlhttp.onreadystatechange = function() 
    { 
     if (xmlhttp.readyState == 4 && xmlhttp.status == 200) 
     { 
     alert("success"); 
     } 
     else 
     { 
     alert("failure"); 
     } 
    }; 

答えて

0

あなたは同じ起源の制限によって制限されています。あなたの仲介を構築することができますか?(あなたのドメインにRSSを引き込むPHPスクリプトのようなものです)あなたはそのスクリプトにあなたのURLを変更しますか?

<?php 
$x=file_get_contents('http://www.vworker.com/RentACoder/misc/LinkToUs/RssFeed_newBidRequests.asp?blnAllOpen=true'); 
echo $x; 
?> 
関連する問題