·ÅÒ»¸öjavascriptÓÒ¼ü²Ëµ¥µÄ´úÂë
×¢²áºÜ³¤Ê±¼äºÅÁË£¬¸Õ¿ªÍ¨²©¿Í£¬ÄóöÒ»¸ö×Ô¼ºÐ´µÄjavascriptÓÒ¼ü²Ëµ¥£¬¼æÈÝIE£¬firefoxä¯ÀÀÆ÷
ÕâÊÇcss´úÂë
body{
font-size:12px;
}
.contextMenu{
filter:alpha(opacity=80);
opacity:0.8;
border:1px #0033FF solid;
background-color:#0099CC;
cursor:pointer;
width:120px;
position:absolute;
top:0;
left:0;
font-size:12px;
}
.cmddiv{
padding:2px;
border-bottom:1px #00FF99 dotted;
}
»¹ÓÐjavascript´úÂë
window.onload=function(){
var contextMenu;
var buttons=['²Ëµ¥1','²Ëµ¥2','²Ëµ¥3','²Ëµ¥4'];
window.document.body.oncontextmenu=function(e){
var xy=getXY(e);
if(typeof contextMenu!="object"){
contextMenu=document.createElement("div");
for(var i=0;i<buttons.length;i++){
var div=document.createElement("div");
var cmd=document.createTextNode(buttons[i]);
div.eventDiv=i;
div.className="cmddiv";
div.appendChild(cmd);
contextMenu.appendChild(div);
}
contextMenu.className="contextMenu";
window.document.body.appendChild(contextMenu);
contextMenu.onclick=function(e){
var e = e||window.event;
var target=e.target||e.srcElement;
alert(target.eventDiv);
}
}
contextMenu.style.display="";
contextMenu.style.top=xy.y+10+"px";
contextMenu.style.left=xy.x+10+"px";
return false;
}
window.document.body.onclick=function(){
if(typeof contextMenu=="object"){
contextMenu.style.display="none";
}
}
var getXY=function(e){
var x,y;
var e = e||window.event;
return {x:e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,y:e.clientY+document.body.scrollTop+document.documentElement.scrollTop};
}
}
´úÂëֻдµ½Åжϳöµã»÷µÄÊÇÄǸöÃüÁÖÁÓÚҪʵÏֵĺ¯Êý£¬»¹ÊÇÒª×Ô¼ºÐ´µÄ
Ïà¹ØÎĵµ£º
¼ò½é
¡¡¡¡1st JavaScript Editor ÊÇÒ»¿îÇ¿´óµÄJavaScript¿ª·¢¡¢Ð£ÑéºÍµ÷ÊÔ¹¤¾ß£¬Ëü¼òµ¥Ò×Ó㬲»ÂÛÄãÊdzõѧÕß»òÕßÊÇרҵµÄ¿ª·¢ÈËÊ¿£¬¶¼¿ÉÒÔÇáËÉÉÏÊÖ£¡Í¬Ê±ËüÓÖÊÇÍêÃÀµÄAjax (Asynchronous JavaScript and XML),CSS, HTML, DOM DHTML¿ª·¢¹¤¾ß£¡
¡¡¡¡Beside rich possibilities of editing scripts (JavaScript, ......
JavaScript gives HTML designers a programming tool - HTML authors are normally not programmers, but JavaScript is a scripting language with a very simple syntax! Almost anyone can put small "snippets" of code into their HTML pages
JavaScript can put dynamic text into an HTML page - A Ja ......
±¾ÎĵÄÁ½¸öÄ¿µÄ£º
£¨1£©½éÉÜjavascriptÖеÄevalº¯ÊýµÄÓ÷¨
£¨2£©ÈçºÎÔÚº¯ÊýÄÚÖ´ÐÐÈ«¾Ö´úÂë
►ÏÈÀ´ËµevalµÄÓ÷¨£¬ÄÚÈݱȽϼòµ¥£¬ÊìϤµÄ¿ÉÒÔÌø¹ý¡£
evalº¯Êý½ÓÊÕÒ»¸ö²ÎÊýs£¬Èç¹ûs²»ÊÇ×Ö·û´®£¬ÔòÖ±½Ó·µ»Øs¡£·ñÔòÖ´ÐÐsÓï¾ä¡£Èç¹ûsÓï¾äÖ´Ðнá¹ûÊÇÒ»¸öÖµ£¬Ôò·µ»Ø´ËÖµ£¬·ñÔò·µ»Øundefined¡£
ÐèÒªÌرð×¢ÒâµÄÊǶÔÏóÉùÃ÷Óï· ......
<iframe width='100%' height='100%' name='boot' id='boot' src='' frameborder='0' scrolling='no'></iframe>
<SCRIPT LANGUAGE="JavaScript">
<!--
var iframe = window.frames['boot'];
iframe.document.open();
iframe.document.write('<!DOCTY ......
ÏÈÀ´¿´Ò»¸ö¼òµ¥µÄÀý×Ó£º
ÏÂÃæÒÔÈý¸öÒ³Ãæ·Ö±ðÃüÃûΪframe.html¡¢top.html¡¢bottom.htmlΪÀýÀ´¾ßÌå˵Ã÷ÈçºÎ×ö¡£
Java´úÂë
frame.html ÓÉÉÏ(top.html)ÏÂ(bottom.html)Á½¸öÒ³Ãæ×é³É£¬´úÂëÈçÏ£º
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> ......