同步跳转的链接
<a href="http://www.baidu.com/" onclick="openClick()">这是跳转的链接</a>
<script type="text/javascript" src="../js/jquery-1.4.2.js"></script>
<script type="text/javascript">
function openClick(type){
//alert('dd');
var result = false;
$.ajaxSetup({
async:false//将ajax异步处理设置成同步
});
$.getJSON("http://www.com/index.php?a=share",function(data){
if(data.success==2){
show_login();
result = false;
}
else if(data.success==1)
{
var url="http://www.jiathis.com/send/?webid="+type+data.msg;
//var vra=document.createElement('a');
//vra.target='_blank';
// vra.href=url;
//document.body.appendChild(vra);
// vra.click();
$("#"+type).attr('href',url);
result = true;
}else{
alert(data.msg);
result = false;
}
});
return result;
}