javascriptдÔÚº¯ÊýÀïÃæ
javascriptдÔÚº¯ÊýÀïÃæ
function loadscript(url) {
document.write('<scr' + 'ipt type="text/javascript" src"' + url + '"><\/scr' + 'ipt>'>)
}
Ôڳɹ¦µÄÕýÔò±í´ïʽ²éÕÒÍê³É֮ǰ£¬ÆäÊôÐÔֵΪ undefined¡£
²»Òª½«È«¾Ö RegExp ¶ÔÏóÓë ÕýÔò±í´ïʽ
¶ÔÏó»ìÏý¡£¾¡¹ÜÌýÆðÀ´ÏñÊÇÒ»»ØÊ£¬µ«ËüÃÇÊǽØÈ»²»Í¬µÄ¡£È«¾Ö RegExp
¶ÔÏóµÄÊôÐÔ°üº¬²»¶Ï¸üеĹØÓÚÿ¸öÆ¥Åä³öÏÖµÄÐÅÏ¢£¬¶øÕýÔò±í´ïʽ¶ÔÏóÖ»°üº¬³öÏÖÕýÔò±í´ïʽƥÅäµÄÐÅÏ¢¡£
ÏÂÃæµÄÀý×ÓÑÝʾÁËÈ«¾Ö
JavaScriptÖÐRegExp¶ÔÏóµÄÓ÷¨¡£
function
matchDemo(){
var s;
var re = new RegExp("d(b+)(d)","ig");
var str = "cdbBdbsbdbdz";
var arr = re.exec(str);
s = "$1
contains: " + RegExp.$1 + "\n";
s += "$2 contains: " + RegExp.$2 +
"\n";
s += "$3 contains: " + RegExp.$3;
return(s);
}
Ïà¹ØÎĵµ£º
±¾ÎÄÖ÷ÒªÊdzöÓÚÓÐÅóÓÑʹÓÃÎÒÔÀ´Ð´µÄautocompleteµÄJS¿Ø¼þ¡£µ±Êý¾ÝÁ¿´óµÄʱºò£¬»á³öÏÖЧÂʼ«ÆäÂýµÄÇé¿ö£¬ÎÒÔÚÕâ¶Îʱ¼ä×ö³öµÄһЩ²âÊÔÒ²¼°Ò»Ð©¾Ñ飬Óë´ó¼Ò·ÖÏí£¬Èç¹ûÓдíµÄµØ·½£¬»¹ÇëÖ¸³ö¡£
¾¹ý²âÊÔ£¬ÎÒÃǻᷢÏÖÈçϵÄÇé¿ö»òÕß˵µÄ½áÂÛ£¬Èç¹ûÄúµÄ²âÊÔ½á¹ûÓëÎҵIJ»·û£¬Çë˵Ã÷ÔÒò£¬ÒÔ±ãÏ໥ѧϰ¡£
1£©µ±Ò»¸ö½Ï´óµÄHTML×Ö· ......
javascriptµÄStringÀàÄÚÖú¯Êýreplace(regexp, newString)º¯ÊýÌṩÁË×Ö·û´®Ìæ»»¹¦ÄÜ£¬´Óº¯ÊýÔÐÍÉÏ¿ÉÒÔ¿´³öÖ§³Ö Regular Exp¡£´Ëº¯Êý¹¦Äܷdz£ÊµÓ㬵«Ò²Óм¸¸öµØ·½Óеã»ìÏý£¬ÏÂÃæͨ¹ýʵ¼ÊµÄÀý×ÓÀ´ËµÃ÷£º
±ÈÈçÎÒÃÇÏÖÔÚÒªÕë¶Ô´®
var src="<a href="http://xx.com/a/2010 ......
<html>
<body>
<mce:script type="text/javascript"><!--
document.write("<table border=1px>");
for(i=1;i<=9;i++)
{document.write("<tr>");
for (j=1;j<=i;j++)
{document.write("<td class='table1'>"+i+"*"+j+"="+i*j+" & ......
<mce:script type="text/javascript"><!--
document.write("<table border=1px border-color=red>"); //±í¸ñ¿ªÊ¼
for (h = 1; h <= 10; h++) {
document.write("<tr>"); //¿ªÊ¼µÚÒ»ÐÐ
for (s = 1; s <= 10; s++) {
var num = (h-1)*10+s; ......