JavaScriptÏÞÖÆtextarea³¤¶È
ÓÉÓÚTEXTAREAûÓÐmaxlength,²»ÄÜÕâÑùÏÞÖÆtextarea³¤¶È£¬ µ«Í¨¹ýJAVASCRIPT ¾ÍÄÜʵÏÖµ½
<mce:script type="text/javascript"><!--
function limitLength(obj, length) {
var desc = obj.value;
obj.value = substr(obj.value,length);
}
function substr(str,length){
var l=0,i=0;
while(l <length && i<str.length){
l+=1;
if(str.substring(i,i+1).match(/[\u4e00-\u9fa5]/))l+=2;//Ò»¸öÖÐÎÄÊÇÏ൱ÓÚ3¸öÓ¢ÎÄ
i+=1;
}
return str.substring(0,i);
}
// --></mce:script>
<textarea name="blogdesc" cols="50" rows="5" onkeyup="limitLength(this,200)">»Ð»Ðã±ã±»Ð»Ðã±ã±»Ð»Ðã±ã±ºÍ
ÊDz»ÊǺܼòµ¥£¿
Ïà¹ØÎĵµ£º
ʵÀýÈçÏ£ºjavascript.htmlÎļþ
<html>
<head>
<title>JavaScriptÑéÖ¤</title>
</head>
<script language='JavaScript'>
......
ÓÉÓÚºǫ́ģ°åϵͳµÄÇ¿´ó£¬ÈçrailsµÄerb£¬javascriptµÄÄ£°åϵͳһֱ´¦ÓÚ±»´òѹ״̬£¬µ«ÓÖÓÉÓÚºǫ́µÄ¼¼Êõ·¢Õ¹¹ý¿ì£¬ÈÕÐÂÔÂÒ죬ÒÔ¼°AjaxÓ¦ÓõÄÆÕ¼°£¬javascript»¹ÊÇÓÐÒ»½åÖ®µØµÄ¡£ÈçÎÒÃÇÒª´Óºǫ́·µ»ØÒ»¸öHTMLƬ¶Ï£¬µ«ÊÂʵÉÏÎÒÃÇÓÀÔ¶Ö»ÄÜ·µ»ØÎı¾£¨responseText£©»òresponseXML£¬Èç¹ûÄãµÃµ½ÊÇjson£¬Æäʵºǫ́ÒÑÉÔÉÔµ÷ÓÃjavascrip ......
javascriptº¯ÊýµÄ¶¨Òå
1£ºµ÷Óùؼü×ÖfunctionÀ´¹¹Ô죬È磺
function distance(x1,x2,y1,y2)
{
var dx=x2-x1;
var dy=y2-y1;
return Math ......
JavaScriptºÍJavaµÄÇø±ð
¡¡¡¡ËäÈ»JavaScriptÓëJavaÓнôÃܵÄÁªÏµ£¬µ«È´ÊÇÁ½¸ö¹«Ë¾¿ª·¢µÄ²»Í¬µÄÁ½¸ö²úÆ·¡£JavaÊÇSUN¹«Ë¾ÍƳöµÄÐÂÒ»´úÃæÏò¶ÔÏóµÄ³ÌÐòÉè¼ÆÓïÑÔ£¬ÌرðÊʺÏÓÚInternetÓ¦ÓóÌÐò¿ª·¢£»¶øJavaScriptÊÇNetscape¹«Ë¾µÄ²úÆ·£¬ÆäÄ¿µÄÊÇΪÁËÀ©Õ¹Netscape Navigator¹¦ÄÜ,¶ø¿ª·¢µÄÒ»ÖÖ¿ÉÒÔǶÈëWebÒ³ÃæÖеĻùÓÚ¶ÔÏóºÍʼþÇý¶ ......