JavaScript sprintf
Return a formatted string
function sprintf ( ) {
// Return a formatted string
//
// version: 909.322
// discuss at: http://phpjs.org/functions/sprintf // + original by: Ash Searle (http://hexmen.com/blog/)
// + namespaced by: Michael White (http://getsprink.com)
// + tweaked by: Jack
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + input by: Paulo Ricardo F. Santos // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + input by: Brett Zamir (http://brett-zamir.me)
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// * example 1: sprintf("%01.2f", 123.1);
// * returns 1: 123.10 // * example 2: sprintf("[%10s]", 'monkey');
// * returns 2: '[ monkey]'
// * example 3: sprintf("[%'#10s]", 'monkey');
// * returns 3: '[####monkey]'
var regex = /%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuidfegEG])/g; var a = arguments, i = 0, format = a[i++];
// pad()
var pad = function (str, len, chr, leftJustify) {
if (!chr) {chr = ' ';} var padding = (str.length >= len) ? '' : Array(1 + len - str.length >>> 0).join(chr);
return leftJustify ? str + padding : padding + str;
};
// justify() var justify = function (value, prefix, leftJustify, minWidth, zeroPad, customPadChar) {
var diff = minWidth - value.length;
if (diff > 0) {
if (leftJustify || !zeroPad) {
value = pad(value, minWidth, customPadChar, leftJustify); } else {
value = value.slice(0, prefix.length) + pad('', diff, '0', true) + value.slice(prefix.length);
}
}
return value; };
// formatBaseX()
var formatBaseX = function (value, base, prefix, leftJustify, minWidth, precision, zeroPad) {
// Note: cas
Ïà¹ØÎĵµ£º
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 ......
<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µÄ¾ÍÊǰë½Ç£¬· ......
ÎÒÃdz£³£ÔÚ±àдJava³ÌÐòʱ»áÓõ½PropertiesÎļþ£¬°ÑһЩMessageµÈÐÅÏ¢·ÅÔÚPropertiesÎļþ£¬µ«ÊÇÎÒÃÇ¿´µ½µÄ¶¼ÊÇһЩ±àÂë¡£
Struts1.1b2µÄÀý×ÓÖеı¾¹ú×ÊÔ´Îļþ¾¹ýUnicode±àÂëµÄ£¬ËùÒÔÄãÈç¹ûÒªºÍËüµÄÔËÐÐÒ»Ñù£¬Ò²±ØÐ뽫ÄãµÄApplicationResources_zh½øÐÐUnicode±àÂë¡£ÓÐÒÔÏÂÁ½ÖÖ·½·¨£º
¢ÙʹÓÃjdkµÄnative2ascii¹¤¾ß¡£ ......
Flex Óë JavaScript ½»»¥£¬Ö÷ÒªÒÀ¿¿FlexµÄExternalInterface£¬ÆäÌṩÁËaddCallBackºÍcall·½·¨.
ÏÂÃæµÄÀý×Ó½«ÑÝʾFlexµ÷ÓÃjavascript£¬ºÍjavascriptµ÷ÓÃFlex¡£
js ´úÂë
-------------------------------------------------------------------------------------------------------------
function hello(param) {
......
ÕâÀÂǵÄÊÇ.net·þÎñÆ÷¿Ø¼þcheckbox»òcheckboxList£»
¼ÙÉèÒ³ÃæÈçÏ£¬chkDepartÊDz¿ÃÅ£¬chkPeopleÊÇËùÊô²¿ÃŵÄÈËÔ±
<div style="text-align: center" mce_style="text-align: center" width="95%" class="tab">
<asp:DataList ID="DataList1" ......