今天做一个页面,一直在firefox上面测试,等到终于完工了,想起到IE上跑一遍试试 一跑问题就出来了 找到原因问题出在getElementsByName这个方法上 IE无法使用getElementsByName只能用getElementsByTagName 于是只好加上了一个方法 function getElementsByName(tag,eltname){  var elts=document.getElementsByTagName(tag);  var count=0;  var elements=[];  for(var i=0;i<elts.length;i++){  if(elts[i].getAttribute("name")==eltname){  elements[count++]=elts[i];  }  }  return elements;  }还好改动不是特别大  加上这个方法就解决问题了 (改掉原先使用document.getElementsByName的地方为getElementsByName) 还是有点怪怪的 文章来源:
此文被围观1232 分类: 前端设计 标签:  ··


以前总是每次做这个的时候都要到网上来找这方面的教程,这次我把这个教程转载过来了!方便以后查找!jsfunction aa(){ var r=document.getElementsByName("r"); for(var i=0;i...
此文被围观1453 分类: 前端设计 标签:  ····

Ajax to improve the user experience2011-04-25

We use Ajax to interact with the server, without making the visitor load a new page.  This allows for a more enjoyable visit as the user experience is not interrupted by having to load a new page, and it speeds up interaction with the server, as the visitor does not have to download any unnecessary data.  Try our contact page for an example; when the visitor sends their message the page is not reloaded, nor are they taken to a different page.  Instead, the information is updated on the page, thanking the visitor for their contribution or notifying them of any problems, such as a malformed email address....
此文被围观2314 分类: 前端设计 标签:  ··


js计算精度解决办法,这个问题一般出在计算产品数量和价格的和,如果是integer类型那么就会出现小数位不在计算内!所以要改成float类型 提供一个js类 // JavaScript Document function arithmetic(a, sign, b){ if(isNaN(a) || isNaN(b)) return ;if (a == null || a == '') a = 0; if (b == null || b == '') b = 0; if(a.toString().indexOf(".") < 0 && b.toString().indexOf(".") < 0) return eval(a + sign + b); var ra = a.toString().replace(' ', ''); var rb = b.toString().replace(' ', ''); var arr_a = ra.split("."); var arr_b = rb.split("."); var digit_a = (arr_a.length > 1) ? arr_a[1].length : 0; var digit_b = (arr_b.length > 1) ...
此文被围观1942 分类: 前端设计 标签:  ··

本站使用ThinkPHP框架开发读图网主题,目前托管在阿里云,图片由读图网提供. 蜀ICP备12031064号

Copyright © All Rights Reserved.