我正在尝试使用 jQuery 从一个单独的站点基本上启动一个游戏。
http://webstudios.webs.com/rbxlaunch.htm
我的来源是
<html>
<head>
<title>ROBLOX Games!</title>
<iframe width="100%" height="100%" id="Frame" seamless src="" scrolling=no style="position: absolute; top: 200px; left: 0px;"></iframe>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
function VisitPlace(ID) {
alert("Clicked.");
$('#test').trigger('click');
document.getElementById("Frame").src = "http://www.roblox.com/--place?id=" + ID;
$("#Frame").load(function(){
alert("Done loading.");
$('#Frame').contents().find("#ctl00_cphRoblox_VisitButtons_MultiplayerVisitButton").trigger('click')
alert("Enjoy the game");
});
}
</script>
</head>
<body>
<center>
<button onclick="javascript:VisitPlace(487316);">ROBLOX remote visit test.</button>
<button id="test" onclick="javascript:alert('Hello');">Ignore me.</button>
</center>
</body>
</html>
我猜它由于跨域而无法正常工作。有哪些变通方法?