【发布时间】:2016-03-09 08:50:09
【问题描述】:
我对 JavaScript 不太认可,但我需要包括我的 标头到我的 HTML。我们有工作场所提供的联系表格,需要在我的标题中暗示。
但我一直有一个缺少分号的错误,我不知道它在哪个地方。
function writeHeader(){
var html = "";
html += '<header>';
html += '<p class="fL mr15"><a href="javascrip:openWin('002','10100');"><img src="images/head_btn01.png" alt="contact" class="opacity"></a></p>';
html += '</header>';
document.write(html);
}
这部分实际上不起作用:<a href="javascrip:openWin('002','10100');">
【问题讨论】:
-
javascrip是一个错字... -
javascrip:openWin('002','10100');看到了吗?脚本?此外,我们不知道是否定义了 openWin(在这种情况下,' 应该被转义) -
很抱歉。这是openWin的js
-
函数 openWin(rShohincd,rShozokucd){ document.frm01.hidShohincd.value = rShohincd; document.frm01.hidShozokucd.value = rShozokucd; wx = 660; wy = 650; x = (screen.width - wx) / 2; y = (screen.height - wy) / 2; winShozoku = window.open('','WindowP','left='+x+',top='+y+',width='+wx+',height='+wy+',menubar=no,location=no,目录=否,滚动条=是,工具栏=否,状态=否,可调整大小=否'); winShozoku.focus(); document.frm01.method = '发布'; document.frm01.target = 'WindowP'; document.frm01.action = 'purai.asp'; // document.frm01.action = 'purai.asp'; document.frm01.submit(); }