Created
May 16, 2017 06:42
-
-
Save downgoon/3057814acf24538848943dacb7ae190e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
$("button").click(function(){ | |
var person = { | |
boxid: '0001', | |
cname: 'hezi1' | |
} | |
$.ajax({ | |
url: 'http://boxcloud.example.com:10010/bind', | |
type: 'post', | |
dataType: 'json', | |
contentType: "application/json;charset=utf-8", | |
success: function (data, status) { | |
alert("Data: " + data + "\nStatus: " + status); | |
}, | |
data: JSON.stringify(person), | |
xhrFields:{withCredentials:true}, | |
crossDomain:true | |
}); | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<button>bind</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment