JavaScript´úÂë½âÊÍ£¨¹ØÓÚÒ»¸öÏÂÀ²Ëµ¥µÄ£©
stuHover = function() {
var cssRule;
var newSelector;
for (var i = 0; i < document.styleSheets.length; i++)
for (var x = 0; x < document.styleSheets[i].rules.length ; x++)
{
cssRule = document.styleSheets[i].rules[x];
if (cssRule.selectorText.indexOf("LI:hover") != -1)
{
newSelector = cssRule.selectorText.replace(/LI:hover/gi, "LI.iehover");
document.styleSheets[i].addRule(newSelector , cssRule.style.cssText);
}
}
var getElm = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i <getElm.length; i++) {
getElm[i].onmouseover=function() {
this.className+=" iehover";
}
getElm[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" iehover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", stuHover);
ÓÐÉ«²ÊµÄJavaScriptº¯Êý°ïæÏêϸ½âÊÍÒ»ÏÂ
²éÕÒLI:hoverÑùʽ£¬ÈôÕÒµ½ÔòÌæ»»ÎªLI.iehover
¶¥1Â¥ ˵µÄ¶Ô¡£
JScript code:
function a() {
alert("頂");
}
ѧϰ¡£
²»ºÃÒâ˼£¬ºÃ¾ÃûµÇ¼csdn¡£Õâ¾Í¸ø·Ö¡£
Ïà¹ØÎÊ´ð£º
ÓÃjavascript½«Êý¾Ýµ¼³öµ½Îı¾Îļþ(txt)ÖÐ..
Ê×ÏȼÙÉèÒѾÓÐÁËÐèҪдÈëµÄÎı¾ÄÚÈÝ var txtContent ="ÐèҪдÈëµÄÄÚÈÝ";
ÏÖÔÚÐèÒªÓÃjavascript½«ÄÚÈÝдÈëtxtÎļþ(Õâ¸ötxtÎļþ²»´æÔÚ,ÐèÒª´´½¨)ÖÐ,È»ºóдºÃÖ ......
<script language="javascript">
function click() {
if (event.button==2) { //button==1Ϊ×ó¼ü
alert('µã»÷²é¿´ÎÄÕÂÏêϸÄÚÈÝ£¡')
}
}
document.onmousedown=click
</script>
ÒÔÉÏ ......
Ëæ×Åä¯ÀÀÆ÷°²È«ÐÔµÄÌá¸ß£¬ÒªÊµÏÖͼƬԤÀÀÒ²Ô½À´Ô½À§ÄÑ¡£
²»¹ýȺÖÚµÄÖÇ»ÛÊÇÎÞÏ޵ģ¬ÍøÉÏÒ²Óкܶà±äͨ»òÏȽøµÄ·½·¨À´ÊµÏÖ¡£
ÔÚÑо¿Á˸÷ÖÖÔ¤ÀÀ·½·¨ºó£¬×÷Ϊ×ܽᣬдÁËÕâ¸ö³ÌÐò£¬¸ú´ó¼ÒÒ»Æð·ÖÏí¡£
ÉÏ´ÎдµÄ¼ò±ãÎÞˢР......
void CWEHelperDlg::OnOK(){
CString code;
//µ÷ÓÃVBSCRIPT£¬Äܵ¯³öÏûÏ¢¿ò,Ò²ÄÜÕýÈ··µ»Ø hello
code = "function main()\r\n\tMsgBox \"ok\"\r\n\tmain=\"hello\"\r\nend functio ......
ÎÒÓÐÒ»¶Îjavascript´úÂ룬Ա¾Ð´ÔÚasp .netÒ³ÃæÀÎÒÏë°ÑËüдÈëasp .netºǫ́´úÂëÖС£ÇëÎÊÒªÔõôд£¿Ð»Ð»£¡
Ò²¾ÍÊÇ˵´ÓaspxÎļþÖУ¬¸ÃΪдÈëaspx.csÖУ¬Çë¸øÊµÀý˵Ã÷¡£
寫ÁËÖ®ááÄã×öʲ麼²Ù×÷£¿
......