/ * js for simple run code function */
<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "Utf-8" /> <Script>window.onload= function() { varOtxt=document.getElementById ('Codetext'); varobtn=document.getElementById ('btn'); Obtn.onclick= function() { varOnewwin=window.open ('About:blank', '_blank'); //open a blank page (BOM) in a new windowONewWin.document.write (otxt.value);//write the value of the input box in a blank page } } </Script> </Head> <Body> <textareaID= "Codetext"rows= "Ten"cols= "Max"></textarea><BR/> <inputID= "BTN"type= "button"value= "Run" /> <!--FF can only close the open window-- </Body></HTML>
@ Black-eyed poet
/ * Side Bottom ads */
<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "Utf-8" /> <style>#div1{width:200px;Height:150px;background:Red;position:Absolute; Right:0;Bottom:0; }Body{Height:2000px;} </style> <Script>Window.onscroll=window.onresize= function() { //Viewable area Dimensions varCLIENTW=Document.documentElement.clientWidth; varClienth=Document.documentElement.clientHeight; //Scrolling Distance varscrolltop=Document.documentElement.scrollTop||Document.body.scrollTop;//Ie,ff | | Chrome //alert (scrolltop);Odiv=document.getElementById ('Div1'); ODiv.style.top=Clienth-Odiv.offsetheight+scrolltop+ 'px';//document.navigater.useragent determine browser type, IE6 use fixed location}</Script> </Head> <Body> <DivID= "Div1"></Div> </Body></HTML>