`
wencan83
  • 浏览: 40551 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
文章分类
社区版块
存档分类
最新评论
文章列表
sdfsdfd
javascript中是没有replaceAll的,只有replace,要想实现replaceAll功能,只有利用正则表达式了 如下: var reg = /\[\/avi\]/ig;    //[/avi]是作为被替换的字符 var val = "[/avi]123"; val = val.replace(reg,'aaa');  //得出的结果应该是'aaa123'
  <script language="javascript">function myFun(oDiv){        var n1 = parseInt(oDiv.scrollTop);        var n2 = parseInt(oDiv.clientHeight);        var n3 = parseInt(oDiv.scrollHeight);        (n1+n2==n3)&&alert('
/******************** * 取窗口滚动条高度  ******************/ function getScrollTop() {     var scrollTop=0;     if(document.documentElement&&document.documentElement.scrollTop)     {         scrollTop=document.documentElement.scrollTop;     }     else if(document.body)     {         s ...
<div style="width:450px; height:18px; overflow:hidden; zoom:1;">    <div style="float:left; height:18px; margin-right:8px; overflow:hidden;">     content     </div>    <div style="width:13px; height:18.1px; float:right; margin-top:-18px;">...< ...
<div style="width:320px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">   </div>
<!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd"><html><head><title>File Input</title><meta http-equiv="content-type" content="text/html; charset=utf-8"><style>body{font-size:13p ...
今天这个问题困扰了我很久,就是firefox3不能获得html file的全路径的问题 因为我做的电子商务网站是要在firefox上面运行的,在后台管理中,需要一个 添加图片的功能,添加图片的时候是需要使用js来预览上传的图片的,所以需要 做一个这样的功能。   一开始我是以为只要用imgFile.value就可以获取上传文件控件的文件的绝对路径。 view sourceprint? <script language="javascript" type="text/javascript"> ...
function test(){  var url = document.getElementById("urlText").value;    /*var reg = "^((https|http|ftp|rtsp|mms)?://)"      + "?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?" //ftp的user@           + "(([0-9]{1,3}\.){3}[0-9]{1, ...
<html xmlns="http://www.w3.org/1999/xhtml" ><head><title>标题页</title><SCRIPT LANGUAGE="JavaScript">function setVariables() {imgwidth=235;      //图像的宽度imgheight=19;      //图像的高度if (navigator.appName == "Netscape") { //netscape下的位置设置    horz=&q ...
<html xmlns="http://www.w3.org/1999/xhtml" ><head><title>标题页</title><SCRIPT LANGUAGE="JavaScript">function setVariables() {imgwidth=235;               //图像的宽度imgheight=19;               //图像的高度if (navigator.appName == "Netscape") { //netscap ...
<!--//学习一下如何利用js来操作cookie//写入 cookie//不区分 cookieName 的大小写//不考虑子键function WriteCookies(cookieName, cookieValue, expires){    if (expires)    {        //指定了 expires        document.cookie =             WriteCook ...
<script> self.moveTo(0,0) self.resizeTo(screen.availWidth,screen.availHeight) </script>打开窗口自动最大化 IE下测试通过
<script>if(self!=top) top.location=self.location;</script><p>查找更多代码,请访问:<a href="http://www.lanrentuku.com" target="_blank">懒人图库</a></p>
<SCRIPT> <!-- var zoomRate = 20; var maxRate = 500; var minRate = 50; var currZoom = 100;  //document.onkeypress = getKey; //window.onload = initZoom;  function GetCookie(name){  if (document.cookie != "") {   zoomc = document.cookie.split("; ");   for (var i=0; i < z ...
Global site tag (gtag.js) - Google Analytics