Fix cross-domain issues
This commit is contained in:
parent
087f612b37
commit
84fb4214d7
6 changed files with 13 additions and 8 deletions
|
|
@ -43,6 +43,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<script src="assets/js/jquery.js" type="text/javascript"></script>
|
||||
<script src="assets/js/iourl.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var q = "";
|
||||
$("#login").click(function() {
|
||||
|
|
@ -52,7 +53,7 @@
|
|||
});
|
||||
|
||||
function refresh() {
|
||||
$.getJSON("api/json/listloaded?" + q, function(data) {
|
||||
$.getJSON(IO_URL+"/api/json/listloaded?"+q+"&callback=?", function(data) {
|
||||
var host = document.location + "";
|
||||
host = host.substring(0, host.indexOf("/widget.html"));
|
||||
if(data.error) {
|
||||
|
|
|
|||
|
|
@ -24,14 +24,13 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<script src="assets/js/jquery.js" type="text/javascript"></script>
|
||||
<script src="assets/js/iourl.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var p = document.location + "";
|
||||
if(p.indexOf("?") != -1) {
|
||||
p = p.substring(p.indexOf("?")+1);
|
||||
}
|
||||
$.getJSON("api/json/channeldata?" + p, function(data) {
|
||||
var host = document.location + "";
|
||||
host = host.substring(0, host.indexOf("/widget.html"));
|
||||
$.getJSON(IO_URL+"/api/json/channeldata?"+p+"&callback=?", function(data) {
|
||||
if(data.error) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
</div>
|
||||
</form>
|
||||
<script src="assets/js/jquery.js" type="text/javascript"></script>
|
||||
<script src="assets/js/iourl.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var source;
|
||||
var respond = function(e) {
|
||||
|
|
@ -44,7 +45,7 @@
|
|||
window.addEventListener("message", respond, false);
|
||||
|
||||
$("#login").click(function() {
|
||||
$.getJSON("api/json/login?name="+$("#username").val()+"&pw="+$("#pw").val(), function(data) {
|
||||
$.getJSON(IO_URL+"/api/json/login?name="+$("#username").val()+"&pw="+$("#pw").val()+"&callback=?", function(data) {
|
||||
data.uname = $("#username").val();
|
||||
source.postMessage("cytube-login:"+JSON.stringify(data), document.location);
|
||||
});
|
||||
|
|
@ -58,7 +59,7 @@
|
|||
$("#confirm").addClass("text-error");
|
||||
return;
|
||||
}
|
||||
$.getJSON("api/json/register?name="+$("#username").val()+"&pw="+$("#pw").val(), function(data) {
|
||||
$.getJSON(IO_URL+"/api/json/register?name="+$("#username").val()+"&pw="+$("#pw").val()+"&callback=?", function(data) {
|
||||
console.log(data);
|
||||
data.uname = $("#username").val();
|
||||
source.postMessage("cytube-login:"+JSON.stringify(data), document.location);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue