<script src="jquery.js"></script>
var baseUrl=""
if(document.domain=="localhost"){
baseUrl="http://"+document.domain+":8650"
}else{
baseUrl="https://"+document.domain;
}
function get(url,callback,data) {
.ajax({ type: "GET", url: baseUrl+"/"+url, data: data, dataType: "json", success: function (data) { callback(data) } }); } function post(url,callback,data) {.ajax({
type: "post",
url: baseUrl+"/"+url,
data: data,
dataType: "json",
success: function (data) {
callback(data)
}
});
}
网友评论