Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavaScript¸ñʽ»¯×Ö·û´®¹¤¾ß

Several programming languages implement a sprintf function, to output a formatted string. It originated from the C programming language, printf function. Its a string manipulation function.
This is limited sprintf Javascript implementation. Function returns a string formatted by the usual printf conventions. See below for more details. You must specify the string and how to format the variables in it. Possible format values:
%% – Returns a percent sign
%b – Binary number
%c – The character according to the ASCII value
%d – Signed decimal number
%f – Floating-point number
%o – Octal number
%s – String
%x – Hexadecimal number (lowercase letters)
%X – Hexadecimal number (uppercase letters)
Additional format values. These are placed between the % and the letter (example %.2f):
+ (Forces both + and – in front of numbers. By default, only negative numbers are marked)
– (Left-justifies the variable value)
0 zero will be used for padding the results to the right string size
[0-9] (Specifies the minimum width held of to the variable value)
.[0-9] (Specifies the number of decimal digits or maximum string length)
If you plan using UTF-8 encoding in your project don’t forget to set the page encoding to UTF-8 (Content-Type meta tag), and use Javascript UTF-8 utility found on this website.
Ô­ÎÄÁ´½Ó: http://www.webtoolkit.info/javascript-sprintf.html
ÏÂÔØ:
webtoolkit.sprintf.js
http://download.csdn.net/source/1972105 


Ïà¹ØÎĵµ£º

¹ØÓÚjavascript ²Ù×÷¹â±ê

°æ±¾£ºDHTML Object Model¡¡·µ»ØÖµ£ºÓÐ
Óï·¨£º
oTextRange = object . createTextRange ()
²ÎÊý£º
ÎÞ
·µ»ØÖµ£º
oTextRange : ¶ÔÏó(Element)¡£Èç¹û³É¹¦µÄ»°·µ»Ø±»½¨Á¢µÄ TextRange ¶ÔÏó¡£
˵Ã÷£º
Ϊ object ½¨Á¢ TextRange ¶ÔÏó¡£
ʹÓÃ´Ë TextRange ¶ÔÏó¿ÉÒÔ¼ìË÷ºÍÐÞ¸Ä object ÄÚµÄÎı¾¡£ TextRange ¶ÔÏ ......

JavaScriptÌâÐÍ

1£®ÈçºÎ»ñÈ¡±íµ¥<select>ÓòµÄÑ¡Ôñ²¿·ÖµÄÎı¾£¿
<form name="a">
<select name="a" size="1" onchange="_sel(this)">
<option value="a">1</option>
<option value="b">2</option>
<option value="c">3</option>
</select>
</form&g ......

JavaScript È«½Ç°ë½Çת»»ÎÊÌâ

<script language=JAVAscript>
var s="b";
var strCode
for(var i=0;i<s.length;i++)
{
strCode=s.charCodeAt(i);
if((strCode>65248)||(strCode==12288))
{
alert("ÓÐÈ«½Ç");
break;
}
}
</script>
°ë½Ç×Ö·ûÓÉÒ»¸ö×Ö½Ú±£´æ£¬È«½Ç×Ö·ûÓÃÁ½¸ö×Ö½Ú±£´æ
ËùÒÔÂëÖµµÄ¾ø¶ÔֵСÓÚ256µÄ¾ÍÊÇ°ë½Ç£¬· ......

ÅäºÏjavascript¶¯Ì¬²Ù×÷±íÍ·

Õâ¶Îʱ¼äÔÚÓÃdisplayTag, ËüÓкܶàºÃÓõŦÄÜ,°³Ò²²»¾ÍÔÚÕâ׸Êö,µ±È»Ò²Óм¸¸ö²»·½±ãµÄµØ·½. ±ÈÈçÇóºÍºó"%"µÄÏÔʾµÈÓëÇóºÍÏà¹ØµÄȱµã, ÕâÀïÏȽéÉÜÒ»¸öȱµã²¢°ÑÎÒ´ÓÍøÉÏÕûÀí³öÀ´µÄ½â¾ö·½°¸Ò²Ò»²¢Ìû³ö. ÎÊÌâÊÇÕâÑùµÄ: ÓÉÓÚÒµÎñÒªÇó, µ±Óû§Êó±êλÓÚ±íÖÐijһÁеıêͷʱ, ÔÚÕâ¸ö±íÍ·"¶¯»­"µØÏÔʾÕâÁеļò½é. ÏÈ¿´ÏÂ×ö³öÀ´µÄЧ¹û: ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ