弱弱的问:MSDN中的这个例子怎样才能正确运行?
初学WEB编程,msdn中有个例子:This example uses the event object to check whether the user clicked the mouse within a link, and to prevent the link from being navigated if the SHIFT key is down.
代码如下:
<HTML>
<HEAD><TITLE>Cancels Links</TITLE>
<SCRIPT LANGUAGE="JScript">
function cancelLink() {
if (window.event.srcElement.tagName == "A" && window.event.shiftKey)
window.event.returnValue = false;
}
</SCRIPT>
<BODY onclick="cancelLink()">
好象差了点东西,运行不起来,各位帮忙指点。