$.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);
}
用location.href = res;
替换window.open(res);
window.open()
将打开一个新窗口,而location.href
将更新当前窗口。