兄弟们啊,,等得急啊,,今天就要交啦!!!!!!

shiufurong007 2003-04-08 01:24:13
看看这句是什么意思咯!!
function fix4NS(instr){
var re = /STYLE=\"WIDTH\s*:\s*(\d+)px;\s*HEIGHT:\s*(\d+)px;*\s*\"/gi;
var re1 = /<A\s+href=".*?"\s*>\s*<\/A>/gi; // for taking out blank links
/* changes width and height from style definitions
to plain HTML that NS can understand.
A troublesome output -
<IMG style="WIDTH: 10px; HEIGHT: 10px" width=20 height=30>
will be changed to
<IMG width=10 height=10 width=20 height=30>
DHTML editor takes care of the extra tags.. phew!
S Babu - 11/23/2000
*/
instr=instr.replace(re1, "");
return(instr.replace(re, "width=$1 height=$2"));
}
...全文
27 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
无爱大叔 2003-04-08
  • 打赏
  • 举报
回复
\s 空格字符
* 匹配前面的项目0或多次
//gi 全局匹配大小写不敏感
\d 任何数字
$1,$2访问子字符串从左到右进行编号从$1开始到$9。
无爱大叔 2003-04-08
  • 打赏
  • 举报
回复
正则
匹配大小写不敏感的形如:
style="width :33px;height :44px; "
<a href="a.asp " > </a>
的语法。

87,921

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧