Anyone any ideas?
Nor have this ever seen in some documentation
and let me know where to find??
Hey Guru's, HELP please!!
??xml version="1.0" encoding="utf-8" standalone="yes"?> If The /s and /m modifiers both override the These are usually written as ``the The By default, the ``^'' character is guaranteed to match at only the beginning of the string, the ``$'' character at only the end (or before the newline at the end) and Perl does certain optimizations with the assumption that the string contains only one line. Embedded newlines will not be matched by ``^'' or ``$''. You may, however, wish to treat a string as a multi-line buffer, such that the ``^'' will match after any newline within the string, and ``$'' will match before any newline. At the cost of a little more overhead, you can do this by using the To facilitate multi-line substitutions, the ``.'' character never matches a newline unless you use the /s modifier, which in effect tells Perl to pretend the string is a single line--even if it isn't. The /s modifier also overrides the setting of ?multiple lines ?. W号是永q也不会用来匚w newline 的,也就?/m 的优先屏蔽?. W号对于 newline 的匹配,如果要 . 能够匚w newline, 那么请?/s 使用 \Q 开始,\E l束Q可使中间的标点W号失去Ҏ意义Q将中间的字W作为普通字W?/p>
使用 \U 开始,\E l束Q除了具?\Q...\E 相同的功能外Q还中间的写字母转换成大写。在大小写敏感模式下Q只能与大写文本匚w?/p>
使用 \L 开始,\E l束Q除了具?\Q...\E 相同的功能外Q还中间的大写字母转换成小写。在大小写敏感模式下Q只能与写文本匚w?/p>
\Q...\E 适合用于Q表辑ּ中需要比较长的普通文本,而其中包含了ҎW号?/p>
表达?/p>
说明 \Q(a+b)*3\E 可匹配文?"(a+b)*3"?/p>
\(a\+b\)\*3 如果不?\Q...\E q行转义Q则Ҏ个特D符可行{义?/p>
window.onload = function(){ document.getElementById('div_test').innerHTML = '<c:out value="不知不觉" />';
non-deterministic finite automata (NFAs or NDFAs).
the syntax of regular expressions in Perl:
use locale
is in effect, the case map is taken from the current locale. See the perllocale manpage.
$*
setting. That is, no matter what $*
contains, /s without /m will force ``^'' to match only at the beginning of the string and ``$'' to match only at the end (or just before a newline at the end) of the string. Together, as /ms
, they let the ``.'' match any character whatsoever, while yet allowing ``^'' and ``$'' to match, respectively, just after and just before newlines within the string.
/x
modifier'', even though the delimiter in question might not actually be a slash. In fact, any of these modifiers may also be embedded within the regular expression itself using the new (?...)
construct. See below.
/x
modifier itself needs a little more explanation. It tells the regular expression parser to ignore whitespace that is neither backslashed nor within a character class. You can use this to break up your regular expression into (slightly) more readable parts. The #
character is also treated as a metacharacter introducing a comment, just as in ordinary Perl code. This also means that if you want real whitespace or #
characters in the pattern (outside of a character class, where they are unaffected by /x
), that you'll either have to escape them or encode them using octal or hex escapes. Taken together, these features go a long way towards making Perl's regular expressions more readable. Note that you have to be careful not to include the pattern delimiter in the comment--perl has no way of knowing you did not intend to close the pattern early. See the C-comment deletion code in the perlop manpage.
关于 /m/s l出一个合理的解释Q(通过现象分析实质Q?br />
/m
modifier on the pattern match operator. (Older programs did this by setting $*
, but this practice is now deprecated.)
$*
, in case you have some (badly behaved) older code that sets it in another module.
当有.出现在匹配换行符的位|的时候, 那么将正则在解析的时?/s 的优先要高Q也是字W串q行 sigle line 的解析了?br />
当出?^ 或?$ 来匹配开始位|和l束位置的时候,即ɘq个时候也出现?. W号来匹配换?正则在解析的时?/m 的优先要搞Q也是字W串q行 multiple lines 的解析了?/p>
q就是两个的正则W号的ƈ集,一个不行,另一个顶上的原则?br />
具体可以通过相应的正则调试工兯行测试?
关于 /x 的合理解释:Q通过例子调试获取l果Q?br />
/x 也成为扩展模式,q是 Regex Match Tracer 告诉我们的。他在正则表辑ּ中允许出现空g?# 的注释,但是q些注释字符ԌI格以及 # 后面出现的字W)q不匚w实际的字W串?br />
转义字符 \Q...\E
说明
举例
]]>
如果?html 中写不知名的标签Q?html 是会忽略掉这个标{Q!
比如你徏一?html 标签Q然后有以下内容:
一个解释就是,jsp 是在服务器端p行编译解释,~译解释为响应的 html ?class ,然后?html 发送到客户端?br />
问题出来了Q如果我利用 js 在客Lq行 innerHTML Q其?inner 的内容含?jsp 标签Q那么页面会如何处理Q按照上面的解释执行Q我们应该得不到我们q行标签处理的结果?br />
试内容如下:
<script type="text/javascript">
window.onload = function(){
document.getElementById('div_test').innerHTML = '<c:out value="中国Q强? />';
}
</script>
<div id="div_test">
Hello world
</div>
<c:out value="你好Q世? />
你猜Q?div_test 的内Ҏ什么?
对了Q是 "中国Q强? - ?Z么是q个字符Ԍjstl 的标{不是在服务器端处理的吗Q?br />
恩。因Z服务器发q来 html 的时候,已经?js 的jstl标签部分转ؓ了字串了Q所以浏览器解释执行的时候就当做普通的字符串处理?br />
那么Q利?jsQjs 文g单独的通过 <script src /> 导入Q?来进?innerHTML ?jstl 标签呢?会怎样昄Q?br />
因ؓq样的话Qjs 不会被服务器解释?br />
<script src="../js/test.js"></script>
<body>
<div id="div_test">
Hello world
</div>
<c:out value="你好Q世? />
</body>
?test.js 的内容ؓ:
}
l果是,?div_test 的内容变ZI?....
因ؓ览器将不知名的标签以及其属性不q行M的解释!Q如果标{有内容Q就仅仅昄标签的内宏V?br />
比如Q?<abcd value="哈哈" ></abcd> ׃昄为空。?<abcd>哈哈</abcd> ׃仅显C标{之间的内容 “哈哈”?br />
又由?js 没有l过览器解析,直接?nbsp;jstl 标签 inner C html 中,所以这个标{ְq是方知道了层之_览器解析时不识别,所以就挂掉了?br />
一个相关的问题是Q?如果我从服务器直接获取数据(利用 AjaxQ,然后?js q行数据处理Q我们如果在 js 中利?innerHTML = "jstl 标签 处理我们的数? 的话Q就挂掉了。?br />
如果利用 ajax 获取数据Q数据的格式化,要么在服务器端格式化好,要么定义专门?nbsp; js 来格式化?br />
具体情况Q具体分?.....
一个附带的问题?br />
如果我引入的js 文gQ?nbsp;<script src="test.js" /> Q?与我的页面的 js 文g定义的方法或者事件有冲突Q是如何执行的?
比如:都定义有 window.onload 事g.,谁会被采UIQ?br />
我还以ؓ都会执行呢,只是后面的方法会覆盖前面的方法中相同的处理?br />
但是不是的?br />
他只选择处理在后面定义的一个。!
也就是说Q如?<script src= '' /> 攑֜我页面定义的Ҏ的后面,它就执行 <script src='' />中的Ҏ?br />
归结Z点: 后面的覆盖到了前面的?
]]>
配置?reloadable = "false"
?jsp 的页面部分(而非<%= %> Q?部分有更新时Q服务器不会重启Q服务器动态编?jsp 佉K面能够读取到最C息?br />
当更改了 jsp 的类部分Ӟ服务器同样不户重启,服务器仍旧可以动态编?jsp .
不过Q?jsp 在更C后,假设你浏览器输入了一个当前工E的一个错误目录而?404 错误Q然后再重新定位到更改后?jsp 面Q注意不要经q?servlert 跌{Q,它就会显C更新前的页面,而不会立xC更新后的页面。如果你h一下,它就会显C更新后的页面了Q如果你?jsp 是通过 servlet 重定?forward) q来的,那么 你的面会马上显C出来最新的更新Q而不会需要页面刷新才能获取最新的面。这是ؓ什么?是服务器的原因还是客L~存的原因呢Q?br />
当?04 错误之后Q我清空了客L的缓存,然后q行试Q果然能够得到结果?那会不会是我清空~存的时候本w就耗费了很长时_然后服务器已l重新编译了呢?也就_我还要进行的试是不清I缓存,{待一定长的时_然后回到正确的页面,看页面是否有正确的数? {了 n 长时_?url 中输入正的路径后,q是得不到最新数据,由此可以看出q是客户端的错,而不是服务器的错。(开始是怀疑服务器的缓存,服务器的动态编译问题。)
c?.java ) 文g的修改在 reload ='false' 的时候,服务器不能进行重启也׃能读取类文g的更新?br />
即你在某个cMd了某个方法,但是没有重启服务器,你在 jsp 中调用这个类的方法,会报错!
比如 Student cd?(其中cȝ stuSex 属性是在运行的时候添加上ȝ)
我想用javascript动态增加行,当form中没有table标签时是可以增加?像上面增加了table标签出现错误了,请问各位该如何解?
试代码如下Q?br />
ȝQ这也算一个有点奇妙的问题吧?/p>
?jsp 面
转自: http://www.cnblogs.com/yoyozhou/archive/2007/02/12/648375.html
众所周知Q在表单中加?strong>onsubmit="return false;"可以L表单提交?
下面是简单的一段代码Q?
<form action="index.jsp" method="post" onsubmit="submitTest();">
<INPUT value="www">
<input type="submit" value="submit">
</form>
<SCRIPT LANGUAGE="JavaScript">
// 一些逻辑判断
<!--
function submitTest() {
return false;
}
//-->
</SCRIPT>
若答案ؓ是,׃用往下看了?/p>
若答案ؓ否,错了。实际情冉|表单正常提交Q若惛_不提交,应该?
<form action="index.jsp" method="post" onsubmit="submitTest();">
<form action="index.jsp" method="post" onsubmit="return submitTest();">
ZQ?/p>
原来onsubmit属性就像是<form>q个html对象的一个方法名Q其|一字符Ԍ是其方法体Q默认返回trueQ?/p>
和Java一P在该Ҏ体中你可以写L多个语句Q包括内|函数和自定义函敎ͼ?
onsubmit="
alert('haha'); // 内置函数
submitTest(); // 自定义函?br />
alert(this.tagName); // 用到了this关键?br />
......(L多条语句)
return false;
"
Form.prototype.onsubmit = function() {
alert('haha'); // 内置函数
submitTest(); // 自定义函?br />
alert(this.tagName); // 用到?span class="ident">this关键?/span>
......(L多条语句)
return false;
};
l过q样的分析后Q以上情况就不难理解了:
<form action="index.jsp" method="post" onsubmit="submitTest();">
Form.prototype.onsubmit = function() {
submitTest();
};
<form action="index.jsp" method="post" onsubmit="return submitTest();">
Form.prototype.onsubmit = function() {
return submitTest();
};
l论Q?
我们可以用Java里的思维方式来思考模拟JavaScript中的cM情况QJavaScript中基于prototype的面向对象技术也实是这样做的)Q但他们毕竟q是有本质上的区别,如Java是强cd的,有严格的语法限制Q而JavaScript是松散型的。象上述ҎQ?
Form.prototype.onsubmit = function() {
};
The visibility property sets if an element should be visible or invisible.
visibility属性可讄元素为可见还是不可见
Note: Invisible elements takes up space on the page. Use the "display" property to create invisible elements that do not take up space.
注意Q不可见的元素会占据面的空间。可以?display"属性来让不可见的元素同时不占据面的空?/p>
Note: This property is used with scripts to create Dynamic HTML.
注意Q这个属性经常在建立动态HTML的时候用?/p>
Inherited: No
l承性:?/p>
p { visibility: visible } |
Value | 描述 |
---|---|
visible | The element is visible 元素可见 |
hidden | The element is invisible 元素不可?/td> |
collapse | When used in table elements, this value removes a row or column, but it does not affect the table layout. The space taken up by the row or column will be available for other content. If this value is used on other elements, it renders as "hidden" 当在表格元素中用的时候,q个值可以移除一行或是一列,但它不会影响到表格的布局。被行或列所占据的空间对其他内容来说依然是有效的。如果这个值用到别的元素上它所反馈的效果就?hidden"一栗?/td> |
在IE?select属于windowcd控gQ它?#8220;挡住”所有非windowcd控g 有多U种办法; 以下例子pȝ上资源整?/p> 原址Q?a >http://hi.baidu.com/suofang/blog/item/72f2f7ed23f2324e78f055c4.html W?U方法的例子Q最好的ҎQiframe来当作div的底 Div被Select挡住Q是一个比较常见的问题?nbsp;
W?U方法的例子Q最直接的方?隐藏下拉? 下面提供的是一个比较通用的一l函? test.htm ------------ <script> function cal_ShowElement(){ function cal_GetOffsetTop(src){ </script> 以上q种Ҏ,如果对于select框数目少,相对固定的话,直接用obj.style.visibility="hidden"q样q行隐藏是更直接? W?U方法:用iframe作蝲?/strong> 以下是一单的例子: ----------- <html> function show(){ W?U方法:Object对象的优先度较高,可以挡住select?/strong> <OBJECT id=aa style="display:none;z-index:1000; position:absolute; top:0; left:0; width:152; height: 200;" type="text/x-scriptlet" data="about:<body><div style='position:absolute;left:0;top:0;width:152;height:200;font:14;color:white;background:black;border:1 solid black'>test</div>"></OBJECT> q种Ҏ虽然也简?但对复杂的层是来说还不是好的解决Ҏ. |