0
我相信這個問題已經被問很多時候,但我不能弄清楚什麼是錯我的代碼..跨域訪問,YQL
我試圖訪問CareerBuilder網站的API來獲取在聖何塞的工作列表。該請求以響應代碼200(OK)執行,但是,我無法查看任何響應。
$(document).ready(function(){
var url2use="http://api.careerbuilder.com/v1/jobsearch?DeveloperKey=WDHS54569PZ5S5SPPVHH&BooleanOperator=OR&CountryCode=US&Keywords=student,part-time,intern&Radius=30&PerPage=50&Location=San Jose, Santa Clara";
var yqlUrl2use = "http://query.yahooapis.com/v1/public/yql?"+"q=select%20*%20from%20html%20where%20url%3D%22"+encodeURIComponent(url2use)+
"%22&format=xml&callback=?";
$.ajax({
url: yqlUrl2use,
dataType: "html",
type: "GET",
success: function(xml) {
var myXML = xml.responseText;
// what i want to do with results
}
}
});
});