JavaScript ÅжÏä¯ÀÀÆ÷ÀàÐͼ°°æ±¾
$(document).ready(function() {
var Sys = {};
var ua = navigator.userAgent.toLowerCase();
if (window.ActiveXObject)
Sys.ie = ua.match(/msie ([\d.]+)/)[1]
else if (document.getBoxObjectFor)
Sys.firefox = ua.match(/firefox\/([\d.]+)/)[1]
else if (window.MessageEvent && !document.getBoxObjectFor)
Sys.chrome = ua.match(/chrome\/([\d.]+)/)[1]
else if (window.opera)
Sys.opera = ua.match(/opera.([\d.]+)/)[1]
else if (window.openDatabase)
Sys.safari = ua.match(/version\/([\d.]+)/)[1];
//ÒÔϽøÐвâÊÔ
if (Sys.ie) $("#llq").html("IE:" + Sys.ie);
if (Sys.firefox) $("#llq").html("Firefox: " + Sys.firefox);
if (Sys.chrome) $("#llq").html('Chrome: ' + Sys.chrome);
if (Sys.opera) $("#llq").html('Opera: ' + Sys.opera);
if (Sys.safari) $("#llq").html('Safari: ' + Sys.safari);
})
Ïà¹ØÎĵµ£º
ʹÓÃtry{...}catch(){} ·½Ê½£¬Àý×ÓÈçÏ£º
function showAlarm(strObject){
try{
svgElement = document.getElementById(strObject);
svgElement.setAttribute("visibility","visible");
setTimeout("hideAlarm()",3000);//3Ãëºó½áÊø±¨¾¯
}catch(ex){
alert("º¯ÊýshowAlarm()·¢ÉúÒì³££º"+ex.descrip ......
³ÌÐòÉè¼ÆÖлᾳ£Åöµ½Ò»ÖÖÇé¿ö£¬¾ÍÊÇÊÂÏÈÎÞ·¨µÃÖªÓû§»áÐèÒªÄÄЩÊý¾Ý£¬±ØÐë¸ù¾ÝÓû§Ñ¡ÔñºóÔÙ´Ó·þÎñÆ÷
ÖØÐÂÌáÈ¡Êý¾Ýºó·´À¡¸øÓû§¡£±ÈÈçÒ»¼òµ¥µÄÇé¿ö£¬Óû§Ñ¡ÔñÊ¡·ÝÒÔºó£¬ÎÒÃÇÁ¢¼´»áÔÚÊÐÀï±ß½«Õâ¸öÊ¡µÄËùÓÐ
ÊÐÖØÐÂÏÔʾ³öÀ´¡£ÕâÖÖÇé¿öÒ»°ãÐèÒª½«Õû¸öÒ³Ãæˢкó²Å¿ÉÒÔÖØжÁÈ¡£¬µ«ÕâÑù²»½öЧÂʲ»¸ßÍ⣬ҲÏԵò»
Ì«ÓÅÑÅ¡£Æäʵ ......
ÕýÔò±í´ïʽ
RegExp(regexp, option)ÀàʵÏÖ,¿ÉÒÔ¼òд³É/regexp/option
option:
g: global, i: ignore case
·½·¨:string.test(regexp),
string.exec(regexp)[·µ»ØËùÓÐÆ¥ÅäµÄµØ·½], string.serch(regexp)[ÕýÔò°æµÄindexOf()],
string.replace(regexp, str|funtion), string.split(regexp)
¼òµ¥Ä£Ê½
Ôª×Ö·û:( [ {
......
ÔÚjavascript´úÂëÖÐÓÃencodeURIComponent()º¯Êý´¦ÀíÖÐÎÄ×Ö·û´®£¬
JS´úÂ룺
<mce:script type=”text/javascript”><!--
string = encodeURIComponent(string);
location.href = index.php?keyword=’+string;
// --></mce:script>
PHP´úÂë:
<?php
$keyword = (isset($_GET ......
±äÁ¿µÄ×÷ÓÃÓòÖ¸µÄÊDZäÁ¿µÄ¿É¼ûÐÔ£¬¶øÉúÃüÖÜÆÚÔò£¨´æ»îÆÚ£©ÔòÊÇ´ÓÁíÒ»¸ö½Ç¶È¿¼²ì±äÁ¿¡£ jsÖбäÁ¿µÄ×÷ÓÃÓò·ÖΪȫ¾Ö±äÁ¿ºÍ¾Ö²¿±äÁ¿£¬º¯ÊýÄÚ¶¨ÒåµÄ³ÆΪ¾Ö²¿±äÁ¿£¬º¯ÊýÍâµÄ³ÆΪȫ¾Ö±äÁ¿¡££¨¡°º¯ÊýÍâµÄ³ÆΪȫ¾Ö±äÁ¿¡±ÊÇÏà¶ÔµÄ£¬Áí´Ë´¦ÌÖÂÛµÄÇ°ÌáÊÇÓÃvarÏÔʽÉùÃ÷µÄ±äÁ¿£¬º¯ÊýÄÚ²»ÓÃvar¶¨ÒåµÄ±äÁ¿Ä¬ÈÏÊÇÈ«¾Ö±äÁ¿£¬µ±È»ºöÂÔvarÉùÃ÷± ......