ÓÃJavascript¶¯Ì¬Ìí¼Óɾ³ýHTMLÔªËØʵÀý
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>ÓÃjavascript¶¯Ì¬Ìí¼Óɾ³ýhtmlÔªËØ</title>
<script type="text/javascript"><!--
function $(nodeId) {
return document.getElementById(nodeId);
}
function $Name(tagName) {
return document.getElementsByTagName(tagName);
}
function replaceMsg() {
var newNode = document.createElement("P");//´´½¨Ò»¸öP±êÇ©
newNode.innerHTML = "<font color='red'>Ìæ»»ºóµÄÎÄ×Ö</font>";
var oldNode = $Name("P")[0];//»ñÈ¡bodyÀïÃæµÚÒ»¸öpÔªËØ
oldNode.parentNode.replaceChild(newNode,oldNode);//Ö±½ÓÌæ»»Á˱êÇ©
}
function removeMsg() {
var node = $("p2");//p±êÇ©
var nodeBtn = $("remove");//°´Å¥
//node.parentNode.removeChild(node); //ÏÂÃæЧ¹ûÏàͬ
document.body.removeChild(node);//ÔÚbodyÖÐɾ³ýidΪP2µÄÔªËØ
//nodeBtn.parentNode.removeChild(nodeBtn);//ɾ³ý¸Ã°´Å¥
document.body.removeChild(nodeBtn);
//document.body.removeNode();Ö´ÐÐÕâÌõÓï¾ä½«Çå¿ÕbodyÀïÃæµÄÈκÎÔªËØ
}
function addbefore() {
var newNode = document.createElement("p");//´´½¨P±êÇ©
//var newText = document.createTextNode("Ç°ÃæÌí¼ÓµÄÔªËØ");
//newNode.appendChild(newText);//ÓëÏÂÃæЧ¹ûÒ»Ñù
newNode.innerHTML = "<font color='red'>Ç°ÃæÌí¼ÓµÄÔªËØ</font>";//ÊéдP±êÇ©ÀïÃæµÄÄÚÈÝ
var oldNode = $("p3");//Ä¿±ê±êÇ©
//document.body.insertBefore(newNode,oldNode);
oldNode.parentNode.insertBefore(newNode,oldNode);//ÔÚÄ¿±ê±êÇ©Ç°ÃæÌí¼ÓÔªËØ
}
function addlast() {
var newNode = document.createElement("p");//´´½¨P±êÇ©
//var newText = document.createTextNode("ºóÃæÌí¼ÓµÄÔªËØ");
//newNode.appendChild(newText);//ÓëÏÂÃæЧ¹ûÒ»Ñù
newNode.innerHTML = "<font color='red'>ºóÃæÌí¼ÓµÄÔªËØ</font>";
var oldNode = $("p3");&n
Ïà¹ØÎĵµ£º
ÍøÕ¾¾³£Óõ½µÄÒ»¸ö¶«Î÷ÓÃÀ´ÔÝ´æһЩÏà¹ØÐÅÏ¢µÄCookieÓÐÓŵãÒ²ÓÐȱµã£¬ËüÄܹ»²»Õ¼Ó÷þÎñÆ÷×ÊÔ´£¬´æ´¢ÔÚ¿Í»§¶ËµÄµçÄÔÀ¿ÉÕâÑùÒ²ÓÐÒ»¶¨µÄΣÏÕÐÔ£¬ÒòΪÏà¹ØÐÅÏ¢±ÈÈç˵µÇ¼ij¸öÍøÕ¾µÄÓû§ÃûºÍÃÜÂëÖ®ÀàµÄÐÅÏ¢£¬¶¼»á´æÔÚ¿Í»§¶ËµÄµçÄÔÀÕâÑù»á±»Ä³Ð©“ÓÐÐÄÖ®ÈË”ÀûÓã¬ËùÒÔ£¬ÓÐЩÈËÏ°¹ßÔÚ¹«¹²³¡ºÏʹÓÃÍêµçÄÔºóÇåµôCo ......
to make a note that I love JavaScript. This article is only meant for some fun, and for us to be aware of some its short-comings.
1. The Name. JavaScript is NOT Java
We'll start with a fun jab at the name choice. While it was originally called Mocha, and then LiveScript, it was later changed to J ......
//¸´ÖÆËùÑ¡±í¸ñµÄÊý¾Ýµ½¼ôÌù°å ×÷Õߣºxx
function copyData(){
var content = "";
var tbl = getTbl();
//»ñÈ¡ËùÑ¡µÄËùÓÐÊý¾Ý
for(j = start_Row; j <= end_Row; j++)
{
for(i = start_Col; i <= end_Col; i++)
{
content += (tbl.rows[j].cells[i].childNodes[0].value);
if(i != end_ ......
javascript²¶»ñ´°¿Ú¹Ø±ÕʼþÓÐÁ½ÖÖ·½·¨
1.ÓÃjavascriptÖØж¨Òå window.onbeforeunload() ʼþ
ÔÚjavascriptÀﶨÒåÒ»¸öº¯Êý¼´¿É
function window.onbeforeunload() { alert("¹Ø±Õ´°¿Ú")}
alert()ʼþ½«»áÔڹرմ°¿ÚÇ°Ö´ÐУ¬ÄãÒ²¿ÉÒÔÓû§¾ö¶¨ÊÇ·ñ¹Ø±Õ´°¿Ú
function window.o ......
ÎÊÌ⣺htmlÔªËØÈçºÎ¹¹³ÉÎĵµ
½â¾ö·½°¸£ºhtmlÊÇÑϸñµÄÔªËزã´ÎǶÌ׽ṹ£¬ÔªËØ¿ÉÒÔ»¥ÏàǶÌ×£¬µ«ÊDz»ÄÜÖصþ¡£Html½«ÔªËØ»®·ÖΪ3¸öÖ÷ÒªÀࣺ½á¹¹»¯ÔªËØ£¬¿é×´ÔªËØ£¬ÄÚÁªÔªËØ¡£
n ºËÐĵĽṹ»¯ÔªËØ£º<html><head><body>£¬<head>ÖзŵÄÊǹØÓÚÎĵµµÄÐÅÏ ......