【发布时间】:2014-02-18 05:27:22
【问题描述】:
我想在同一个锚点的 onclick 方法中使用一个 href。
这是一个锚点:
<a href="http://www.google.com" onclick="VideoTrackNLog('Best Practices 3','www.google.com');"><img alt="Best Practice 3" src="timg/BestPractice3.jpg" style="width: 236px; height: 157px" /> </a></td>
这是 onclick 使用的代码:
function VideoTrackNLog(videoname, filename, file) {
frmVideoTrackNLog.videoname.value = videoname;
frmVideoTrackNLog.nextpagename.value = filename;
frmVideoTrackNLog.submit();
window.open(file,'Video','height=200,width=200,left=190,top=110,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=yes');
}
想法是将href中的URL移动到函数中的第三个参数。有什么办法可以做到吗?
【问题讨论】:
-
你不能把href留空,把URL移动成函数参数吗?
标签: javascript html onclick href