我有一个关于从父浏览器窗口发送一个额外参数以弹出子窗口的问题,到目前为止我已经创建了这段代码。
家长:
function addItem(id_value)
{
var newUrl = $('#add-'+id_value).attr('data-url');
var checkPort = $('#add-'+id_value).attr('id');
$('#add-'+id_value).click(function(){
if(checkPort == 'add-fracht_1_pol_id' || checkPort == 'add-fracht_1_pod_id' || checkPort == 'add-fracht_2_pol_id' ||
checkPort == 'add-fracht_2_pod_id' || checkPort == 'add-fracht_3_pol_id' || checkPort == 'add-fracht_3_pod_id')
{
window.opener.setParam(checkPort);
}
window.open(newUrl, 'newPerson', config='height=1500, width=1000, toolbar=no, menubar=no, scrollbars=yes');
return false;
});
}
孩子:
$(document).ready(function(){
var name = window.name;
var val = Boolean(false);
var check = setParam(val);
alert(check);
if(name == 'newPerson')
{
$('#save').remove();
$('#save_stay').show();
$('.form-actions').append('<input type="hidden" value="1" name="pop" />');
}
else
{
$('#save').show();
$('#save_stay').remove();
}
});
但这并没有,我被卡住了:(