可能重复:
Ajax 跨域调用
在这里使用此代码..
var URLs = new Array();
var titulo = new Array();
$.ajax({
url: 'http://www.example.com.br',
type: 'GET',
success: function(res) {
headline = $(res.responseText).text();
URLs = headline.split(",LK");
CriaVideos(URLs);
}
});
function CriaVideos(URLs)
{
for(var i = 0; i <= 5; i++)
{
var aux = new Array();
aux = URLs[i].split("#");
titulo.push(aux[0]);
titulo.push(aux[1]);
Cria(titulo);
}
}
function Cria(titulo)
{
document.write('<li><div id="frame_video"><a href="TelaVideoWind.php?nome='+ titulo[1]+ '&video=' + titulo[0] + '"><span class="frame_video_img"><img src="img/play.png" width="60px" height="40px" align="middle" style="position: absolute; margin-top: 55px; margin-left: 95px;"/><img src="http:/'+ titulo[0]+ '/i.ytimg.com/vi/hqdefault.jpg" width="250px" height="150px"/></span><span class="frame_video_desc"></span></a></div></li>');
}
它会在标题 document.write 中工作还是在函数之外使用但它不起作用!我想知道是否有人可以帮忙!