³£ÓÃHTMLÒªÇó JavaScript½Å±¾
ÌØÊâJavaScript½Å±¾£º
1.½ûÓÃ(»Ö¸´)href³¬¼¶Á´½Ó£®
2.javascriptÖе÷ÓÃvbs¶Ô»°¿òʵÏÖConfirm,¿ÉÒÔÏÔʾYes,No,»¹Óи÷ÖÖͼ±ê£¬½öIEÏÂÓÐЧ£®
3.ÏÞÖÆÉÏ´«ÎļþÀàÐÍΪjpg.
4.ÏÞÖÆÀ뿪µ±Ç°Ò³Ã棬ÔÚÀ뿪ʱÌáʾ£®½öÏÞÖÆ´°¿Ú¹Ø±Õ»òͨ¹ýij¸öhref³¬¼¶Á´½ÓÀ뿪£®(Ò³ÃæË¢Ðº͵ØÖ·À¸¸Ä±äʱ²»Ìáʾ£©
demo.htmlÈçÏ£º
<html>
<header>
<title>Demo for Javascript</title>
<script>
//½ûÓ󬼶Á¬½Ó
function EnabledLink(flag)
{
var btlink=document.getElementById('linkconfirm');
if(btlink!=null)
{
btlink.disabled = !flag;
btlink.onclick = function() { return flag; };
btlink.style.cursor = flag ? "hand" : "text";
btlink.style.textDecoration = flag ? "" : "none";
btlink.title= flag ? "open other page" : "disabled";
}
}
//ÏÞÖÆÎļþÀàÐÍ
function checktype(uploadfile)
{
var filepath = uploadfile.value
//ÎļþÀàÐÍ´íÎó±ê¼Ç£¬·ÀÖ¹ÖØ¸´µ÷ÓÃ
var hd = document.getElementById('hdfileerror');
if (hd.value.length==0 && filepath.length > 0)
{
filepath = filepath.substring(filepath.lastIndexOf('.') + 1, filepath.length)
if (filepath != 'jpg' && filepath != 'jpeg')
{
Ïà¹ØÎĵµ£º
1.Dean Edwards±àдµÄPacker£¨http://dean.edwards.name/packer/£©£¬ÓÃÓÚѹËõJavaScript
2.»ñÈ¡JQuery£ºhttp:/jquery.com
http://docs.jquery.com/Downloading_jQuery ÏÂÔØ¸÷¸ö°æ±¾¼°ÏàÓ¦°ïÖúÎ ......
JavaScriptÒÔECMAScript±ê×¼×÷Ϊ¹¦ÄÜ»ù×¼£¬ECMAScriptÓÐ5ÖÖÔÐÍÀàÐÍ£ºUndefined£¬Null£¬Boolean£¬NumberºÍString¡£
¿ÉÒÔÓÃtypeofÀ´ÅжÏÀàÐÍ£¬Àý£º
var sTemp = "test string";
alert(typeof sTem ......
ÔÚ×öÒ»¸öÏîÄ¿ÖУ¬½Ó´¥µ½ÁËJavaScript£¬Ö÷ÒªÊǵã»÷Ò»¸ö²éѯ°´Å¥È»ºóµ¯³öÒ»¸öÍøÒ³¶Ô»°¿ò£¬µ±ÔÚ¶Ô»°¿òÖÐÊäÈë²éѯÌõ¼þ£¬µã»÷È·¶¨ºóÓÖ·µ»Øµ½ÔÀ´Ò³Ãæ,µÃ³ö²éѯ½á¹û¡£
Ò³ÃæÈçͼ£º
ÔÚǰ̨¼ÓÁËÒ»¸öÒþ²ØµÄDIV£¬ÀïÃæ·ÅÈëÁ½¸ö¿Ø¼þ¡£ÈçÏ£º
<div style="display:none">
< ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="gb2312">
<head>
<head>
<title> ¹ØÓÚarguments,callee,callerµÈµÄ²âÊÔ &l ......
¢Ùhtml() Ï൱ÓÚinnerHTMLÊôÐÔ ¿ÉÒÔÓÃÓëXHTMLÎĵµ£¬µ±²»ÄÜÓÃÓÚXMLÎĵµ var p_html = $("p").html(); //»ñÈ¡ÔªËØµÄHTML´úÂë $("p").html("......."); ......