执行它
从local主持的请求时,请在以下错误: -
xmlhttprequest不能加载http://192.168.1.3:5080/openmeetings/services/services/user/login?user=user=user& passpasp=pass。请求的资源上没有"访问控制"标头。因此,不允许访问原点" http://localhost"。
代码写为
<script>
$(document).ready(function(){
$("#meet").click(function(){
$.ajax({
method: "GET",
url: "'.$server.'services/user/login",
data: {user: "user", pass: "pass"},
dataType: "json",
success : function(data){
if(data["serviceResult"]["code"]==1){
var code = data["serviceResult"]["message"];
$.ajax({
method: "POST",
url: "'.$server.'services/user/hash?sid=" + code ,
data: {user: JSON.stringify({
firstname: "Edubeans",
lastname: "Student",
externalId: "uid1",
externalType: "myCMS",
login: "pivotal"
}),
options: JSON.stringify({
roomId: 7,
moderator: true,
showAudioVideoTest: true
})
},
dataType: "json",
success : function(data1){
$("#link").html('<a href="'.$server.'hash?secure='+data1["serviceResult"]["message"]+'&language=1" target="_blank">Please click here to Enter the room.</a>');
}
})
}
}
});
});
});
</script>
您的来源是localhost
,但您正在尝试访问位于192.168.1.3
中的另一个来源。
将192.168.1.3
更改为localhost
或
而不是从http://localhost
执行代码,从http://192.168.1.3