javascript中沒有直接提供類似java裡的replaceAll可以用
而javascript裡的replace()也僅能替換第一個符合的字段
後來在網上看到一個不錯的方式
如下
var str = "aabb";
str = str.replace(/\aa/g,'AA');//replace(/\要替換的字段/g,'替換後的字段')
alert(str);
可以把字串中'aa'的部份替換成'AA'
程式不足 敗事有餘
var str = "aabb";
str = str.replace(/\aa/g,'AA');//replace(/\要替換的字段/g,'替換後的字段')
alert(str);
<!DOCTYPE html>按下面的Demo可以看效果!
<html>
<head>
<link type="text/css" href="http://jqueryui.com/latest/themes/base/ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="http://jqueryui.com/latest/jquery-1.3.2.js"></script>
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.core.js"></script>
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.draggable.js"></script>
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.resizable.js"></script>
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.dialog.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#dialog").dialog();
});
</script>
</head>
<body style="font-size:62.5%;">
<div id="dialog" title="Dialog Title">I'm in a dialog</div>
</body>
</html>
$("#elementID").get(0)先取得元素的集合,在從中挑出第X個
$(document.getElementById("elementID"))傳入$()就可以了
#mode_jk Settings加不加註解就看個人習慣了
Include conf/mod_jk.conf
#Load module mod_jk其中最後一項比較重要
LoadModule jk_module modules/mod_jk.so
# Where to find workers.properties
JkWorkersFile conf/workers.properties
# Where to put jk logs
JkLogFile logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
#JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
#JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
#JkRequestLogFormat "%w %V %T"
#close Lookup
#HostnameLookups Off
#what's request should be send to tomcat
JkMount /* controller
worker.list = controller,tomcat1,tomcat2worker.list設定所要整合的tomcat
#========tomcat1========
worker.tomcat1.port=7009 #ajp13 端口號,在tomcat下server.xml配置,默認8009
worker.tomcat1.host=localhost #tomcat的主機地址,如不為本機,請填寫ip地址
worker.tomcat1.type=ajp13
worker.tomcat1.lbfactor = 5 #server的加權比重,值越高,分得的請求越多
#========tomcat2========
worker.tomcat2.port=9009
worker.tomcat2.host=localhost
worker.tomcat2.type=ajp13
worker.tomcat2.lbfactor = 3
#========controller(load balance)========
worker.controller.type=lb
worker.controller.balanced_workers=tomcat1,tomcat2 #指定分擔請求的tomcat
worker.controller.sticky_session=1
這裡的port跟workers.properties裡的一致
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="7009"
enableLookups="false" redirectPort="7443" protocol="AJP/1.3" />
<!-- You should set jvmRoute to support load-balancing via AJP ie : -->jvmRoute=tomcat1這邊也是名稱要一致
<Engine name="Standalone" defaultHost="localhost" jvmRoute="tomcat1">
<Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"拿掉原本的註釋
managerClassName="org.apache.catalina.cluster.session.DeltaManager"
expireSessionsOnShutdown="false"
useDirtyFlag="true"
notifyListenersOnReplication="true">
.
.
.
<ClusterListener className="org.apache.catalina.cluster.session.ClusterSessionListener"/>
</Cluster>
swfobject.embedSWF(swfUrl, replaceElementId, swfWidth, swfHeight, flashVersion其中params是設置參數的部份
,expressInstallUrl, flashvars, params, attributes);
# If CONSOLE is set, root can only login on that device.
# Comment this line out to allow remote login by root.
CONSOLE=/dev/console
# If CONSOLE is set, root can only login on that device.mark第三行就可以了
# Comment this line out to allow remote login by root.
#CONSOLE=/dev/console
<script type="text/javascript">或是
jQuery.noConflict();
</script>
var $j = jQuery.noConflict();使用$j取代jquery的$