ice.js
---------
document.onkeydown = function(){alert(123)};test.htm
----------
<script type="text/javascript" src="ice.js"></script>
---------
document.onkeydown = function(){alert(123)};test.htm
----------
<script type="text/javascript" src="ice.js"></script>
解决方案 »
- createElement("script")无刷处理数据的问题。
- js中含有变量的replace怎么写的?
- JS控制FLASH的运行问题
- window.open打开新窗口怎么在遨游等浏览器中固定大小
- JS动态绑定时间
- firefox下如何得到一个文本框中高亮选中的文字?
- 请教关于javascript的frame页面同步问题
- javascript 的一个问题
- 把程序嵌入网页的问题,请大家帮忙看看,多谢!
- 90分送上:在一个可编辑的iframe 里(designMode=on),鼠标移动是,能有办法改变鼠标的形状吗?好象如document.body.style.cursor="crosshair"这种方法是不行的?
- 关于ShowModalDialog的自身刷新及对不同浏览器的支持?
- 怎么能将html转换成纯文件格式?
<!--
alert(123)
//-->
</SCRIPT>
<SCRIPT LANGUAGE="javascript" FOR="CellWeb" EVENT="MouseLClick(col,row,updn)">
<!--
CellWeb_MouseRClick(col, row, updn)
-->
</SCRIPT>
事件里面是有参数的
<SCRIPT LANGUAGE="JScript">
attachEvent ('onmouseover', Hilite);
attachEvent ('onmouseout', Restore);
function cleanup()
{
detachEvent ('onmouseover', Hilite);
detachEvent ('onmouseout', Restore);
}
function Hilite()
{
if (event.srcElement == element)
{
normalColor = style.color;
runtimeStyle.color = "red";
runtimeStyle.cursor = "hand";
}
}
function Restore()
{
if (event.srcElement == element)
{
runtimeStyle.color = normalColor;
runtimeStyle.cursor = "";
}
}
</SCRIPT>
ParameterssEvent Required. String that specifies any of the standard DHTML Events.
fpNotify Required. Pointer that specifies the function to call when sEvent fires. Return ValueBoolean. Returns one of the following possible values:true The function was bound successfully to the event.
false The function was not bound to the event. ResWhen sEvent fires on the object, the object's sEvent handler is called before fpNotify , the specified function. If you attach multiple functions to the same event on the same object, the functions are called in random order, immediately after the object's event handler is called.The attachEvent method enables a behavior to handle events that occur on the containing page. This method is not limited, however, to behaviors. You can also define a function on a page that attaches to events fired on the same page.Behaviors that attach to events using the attachEvent method must explicitly call the detachEvent method to stop receiving notifications from the page when the ondetach event fires.A behavior that attaches to events on the page using the HTML Component (HTC)?A HREF="/workshop/components/htc/reference/elements/attach.html">PUBLIC:ATTACH element automatically stops receiving notifications when the behavior detaches from the element, and does not need to call the detachEvent method.
Note To use the attachEvent method with Microsoft® Visual Basic® Scripting Edition (VBScript), you need to use the GetRef to obtain a function pointer. The function pointer can then be passed to attachEvent.
我主要是问如何把这堆东西放到一个js文件里面,在页面链接就行了,你这段代码应该不可以放到js文件里面