PDA

View Full Version : حل یک مشکل در اجاکس



shz_furion
جمعه 09 خرداد 1393, 00:18 صبح
سلام.دوستان مشکلی داشتم.
من رای ها رو به این صورت در سیستم جمع آوری می کنم اما مشکلی که داره اینه که وقتی رای میدی،صفحه ای که باید با window.open باز بشه،از طرف مرورگر بلاک میشه صفحه پاپ آپ.
چطور میشه صفحه رو بدون بلاک از طریق مرورگر باز کرد؟؟



<script type="text/javascript">
function submit_rating(action,id){

var up_point_id = "plus-" + id;
var down_point_id = "minus-" + id;
if (action == 'plus'){
var plus='1';
var user_point = document.getElementById(up_point_id).innerHTML;
}
else if (action == 'minus'){
var plus='-1';
var user_point = document.getElementById(down_point_id).innerHTML;
}
var xmlhttp;
if (window.XMLHttpRequest){
xmlhttp=new XMLHttpRequest();
}
else{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState > 0 && xmlhttp.readyState < 4){
}
if (xmlhttp.readyState==4 && xmlhttp.status==200){
var response = xmlhttp.responseText;
var splited_response = response.split("||");
var status = splited_response[0];
var new_point = splited_response[1];
var width = 230;
var height = 355;
var left = (screen.width-width)/2;
var top = (screen.height-height)/2;
if (action == 'plus' && status == 'ok'){
document.getElementById(up_point_id).innerHTML=new _point;
window.open('vote.php?&plus=accept&kind=plus','','width=230px,height=355px,center=1,l eft='+left+',top='+top);
}
else if (action == 'minus' && status == 'ok'){
document.getElementById(down_point_id).innerHTML=n ew_point;
window.open('vote.php?&plus=accept&kind=minus','','width=230px,height=355px,center=1, left='+left+',top='+top);
}
else if(status == 'Err')
{window.open('vote.php?&plus=error&url=themes.themeviews.ir/style.php?theme=15','','width=230px,height=355px,c enter=1,left='+left+',top='+top);;}
}
}
var req = "voted.php?plus=" + plus + "&url=themes.themeviews.ir/style.php?theme=15";
xmlhttp.open("GET",req,true);
xmlhttp.send();
}
</script>
</head>
<body style="margin:0px;padding:0px">
<div class="all" align="left">
<a href="javascript:void(0)" onclick="submit_rating('plus','one');"><img src="images/plus2.png (http://barnamenevis.org/view-source:http://tools.themeviews.ir/like/images/plus2.png)" alt="up" title="امتياز مثبت" border="0" /></a>
<span id="plus-one">6</span>&nbsp;
<span id="minus-one" dir="ltr">3</span>
<a href="javascript:void(0)" onclick="submit_rating('minus','one');"><img src="images/minus2.png (http://barnamenevis.org/view-source:http://tools.themeviews.ir/like/images/minus2.png)" alt="down" title="امتياز منفي" border="0" /></a>
</div>