我无法让第二个 javascript 函数工作。当我单击“发送邮件”按钮时,它应该调用第二个函数并将这两个值传递给它。href 行(第一个函数中的倒数第二行)未正确呈现。
<script>
function getvals(first,second) {
alert(''+first+'');
alert(''+second+'');
mywindow=window.open('','Send Mail','height=200,width=400');
mywindow.document.write("<FORM NAME='test'>");
mywindow.document.write("<table align='center'><tr><td>User/Group: </td><td><input type='text' id='newfirst' name='iuser'></td></tr>");
mywindow.document.test.iuser.value = ''+first+'';
mywindow.document.write("<tr><td>Issue Key: </td><td><input type='text' id='newsecond' name='ikey'></td></tr>");
mywindow.document.test.ikey.value = ''+second+'';
mywindow.document.write("<tr><td><a href='javascript:popitup(document.getElementById('newuser').value,document.getElementById('newkey').value);'>Send Mail</a></td></tr></table>");
mywindow.document.write("</FORM>");
}
function popitup(user,key) {
alert(''+user+'');
alert(''+key+'');
var url = 'http:\/\/localhost:8080/plugins/servlet/mailservlet?receiver=' + user + '&issue=' + key;
newwindow=window.open(url,'name','height=400,width=400');
if (window.focus) {newwindow.focus()}
}
</script>