Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Javascript ÖжÔHTML±àÂëºÍ½âÂëµÄ·½·¨

String.prototype.HTMLEncode = function() {
var temp = document.createElement ("div");
(temp.textContent != null) ? (temp.textContent = this) : (temp.innerText = this);
var output = temp.innerHTML;
temp = null;
return output;
}
String.prototype.HTMLDecode = function() {
var temp = document.createElement("div");
temp.innerHTML = this;
var output = temp.innerText || temp.textContent;
temp = null;
return output;
}
ÉÏÃæ´úÂëת×Ô£ºhttp://www.jb51.net/article/18396.htm
±¾È˶ÔjavascriptµÄºËÐļ¼Êõ²»ÊÇÌ«ÊìϤ£¬ÔÙ¼ÓÉÏÏÖÔÚÓÖÔÚÓò»ÊìϤµÄEXTÀ´±àдǰ̨ҳÃæ´úÂ룬ËùÒÔÖ»µÃÓÃ×µÄ·½·¨£¬²»À©Õ¹String×Ô¼ºÐ´´¦Àíº¯Êý£º
htmlDecode:function(str){
  var temp = document.createElement ("div");
  temp.innerHTML = str;
    var output = temp.innerText || temp.textContent;
    temp=null;
  return output;
 }
htmlEncode:function(str){
  var temp = document.createElement ("div");
  (temp.textContent != null) ? (temp.textContent = str) : (temp.innerText = str); 
  var output = temp.innerHTML;
  temp = null;
  return output; 
 }
ÆäÖÐÓõ½µÄtextContentºÍinnerText ÊôÐÔÈ¡µ½µÄÄÚÈÝÊÇÒ»ÑùµÄ
Ô­ÒòÊÇfirefox²»Ö§³ÖinnerTextÊôÐÔ£¬µ«ÆäÌṩµÄtextContentÊôÐÔºÍinnerText¾ßÓÐÒ»ÑùµÄ×÷Óá£ËùÒÔÉÏÃæµÄ´úÂë¿ÉÒÔ¼æÈÝIEºÍfirefox


Ïà¹ØÎĵµ£º

JavaScriptÀï×Ö·û´®ÀàÐÍת»»³ÉÈÕÆÚÀàÐÍ


JavaScriptÀï×Ö·û´®ÀàÐÍת»»³ÉÈÕÆÚÀàÐÍ£º
Èç¹û×Ö·û´®ÖÐÓпոñ»òÊÇÆäËû·Ö¸î·û·Ö¸î£¬¿ÉÒÔÓÃsplit·½·¨ÏȲð·Ö£¬·µ»ØÒ»¸öÊý×飬ÔÙ°ÑÕâ¸öÊý×éÀïµÄÄêÔÂÈÕ×÷Ϊ²ÎÊý´«µ½new Date()ÀïÉú³ÉÈÕÆÚÀàÐÍ£»
Èç¹ýûÓÐÌØÊâ·Ö¸ô·û£¬¿ÉÒÔÓÃsubstr£¨x£¬y£©·½·¨À´È¡×Ó×Ö·û´®À´Éú³ÉÈÕÆÚ£¬substr£¨x£¬y£©Àx±íʾȡ×Ö´®µÄ¿ªÊ¼Î»Öã¬y±íʾ×Ó´®µÄ³ ......

HTMLÖÐʵÏÖÓÒ¼ü²Ëµ¥¹¦ÄÜ

HTMLÖÐʵÏÖÓÒ¼ü²Ëµ¥¹¦ÄÜ
ÎÒÃÇʹÓõÄÓ¦ÓÃϵͳºÜ¶à¶¼ÓÐÓÒ¼ü²Ëµ¥¹¦ÄÜ¡£µ«ÊÇÔÚÍøÒ³ÉÏÃ棬µã»÷ÓÒ¼üÒ»°ãÏÔʾµÄÈ´ÊÇIEĬÈϵÄÓÒ¼ü²Ëµ¥£¬ÄÇôÎÒÃÇÈçºÎʵÏÖ×Ô¼ºµÄÓÒ¼ü²Ëµ¥ÄØ£¿ÏÂÃ潫½²½âÓÒ¼ü²Ëµ¥¹¦ÄܵÄʵÏÖÔ­ÀíºÍʵÏÖ´úÂë¡£
 
ʵÏÖÔ­Àí
ÔÚHTMLÓïÑÔÖУ¬»ù±¾ÉÏÿ¸ö¶ÔÏó¶¼ÓÐÒ»¸öoncontextmenuʼþ£¬Õâ¸öʼþ¾ÍÊÇÊó±êµÄÓÒ¼üµ¥»÷ ......

ÓÃJavaScript»ñÈ¡QueryString£¨Î´²â£©

function QueryString(fieldName){
var urlString = location.search;
if (urlString != null) {
var typeQu = fieldName + "=";
var urlEnd = urlString.indexOf(typeQu);
if (urlEnd != -1) {
var paramsUrl = urlString.substring(urlEnd + typeQu.length);
var isEnd = paramsUrl.indexOf('&' ......

ÀûÓÃJavaScriptʵÏÖÉÏ´«Í¼Æ¬Ô¤ÀÀ

<script >
function showimage()

       //IMG1ΪͼƬ¿Ø¼þ»òDiv,File1ΪÉÏ´«Îļþ¿Ø¼þ
document.getElementById("IMG1"). src = document.getElementById("File1").value;
}
</script >
¿Ø¼þÖÐÒýÓÃ:
<input id="File1" runat="server" type="file"  onc ......

javascriptʵÏÖÄêÔÂÈÕµÄÁª¶¯Ñ¡Ôñ

<script type="text/javascript">
   
  function dayChange(year,month,day){
   var selectYear = document.getElementById(year);
   var selectMonth = document.getElementById(month);
   var selectDay = document.getElementById(day);
   va ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ