Reputation: 11
$.post('<?php echo base_url()?>index.php/user/clickcode',{'ccode':ssid},function(res){
if(res) { //res will have url like http://google,com
window.open(res);
}
Upvotes: 1
Views: 28
Reputation: 4858
Replace window.open(res);
with location.href = res;
window.open()
will open a new window while location.href
will update the current window.
Upvotes: 1