<script type="text/javascript">
function getUrl(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]); return null;
}
var url = getUrl('guid');
$(document).ready(function() {
var str =$("#cjaword").text();
var doudou = new RegExp("豆");
var result = doudou.test(str);
if(result != true){
$("#form1").css('display','none')
}else{
$("#form1").css('display','block')
};
})
function getCookie(name){
var str = document.cookie;
var attr = strcookie.split("; ");
for ( var i = 0; i < attr .length; i++) {
var arr = attr[i].split("=");
if (arr[0] == name){
return arr[1];
}
}
return "";
}
var c = getCookie('userId')
$('#lingqu').click(function() {
var name= $("#name").val()
var mobile= $("#mobile").val()
$.ajax({
type : "post",
url : "https://www===接口地址==",
/* 返回数据为字符串时dataType为text */
dataType : "text",
data : {
"guid" : url,
"mobile" : mobile,
"userId" : c,
"name" : name,
},
success:function(data) {
alert("success");
},
error:function (data)
{
alert("error");
}
});
})
</script>