锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲国产国产综合一区首页,亚洲性色高清完整版在线观看,亚洲一级特黄大片在线观看http://www.tkk7.com/sealyu/category/45313.html--- The devil's in the Detailszh-cnTue, 22 Jun 2010 23:23:06 GMTTue, 22 Jun 2010 23:23:06 GMT60js鑾峰彇鍏夋爣浣嶇疆錛堣漿錛?/title><link>http://www.tkk7.com/sealyu/archive/2010/06/22/324220.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Tue, 22 Jun 2010 15:17:00 GMT</pubDate><guid>http://www.tkk7.com/sealyu/archive/2010/06/22/324220.html</guid><wfw:comment>http://www.tkk7.com/sealyu/comments/324220.html</wfw:comment><comments>http://www.tkk7.com/sealyu/archive/2010/06/22/324220.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/sealyu/comments/commentRss/324220.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/sealyu/services/trackbacks/324220.html</trackback:ping><description><![CDATA[/**<br /> * 鑾峰彇鍏夋爣鎵鍦ㄧ殑瀛楃浣嶇疆<br /> * @param obj 瑕佸鐞嗙殑鎺т歡, 鏀寔鏂囨湰鍩熷拰杈撳叆妗?br /> * @author hotleave<br /> */<br /> <br /> <textarea id="runcode0" class="codeTextarea" cols="60" rows="15"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=GBK" /> <title>js鑾峰彇鍏夋爣浣嶇疆</title> <script type="text/javascript"> /** * 鑾峰彇鍏夋爣鎵鍦ㄧ殑瀛楃浣嶇疆 * @param obj 瑕佸鐞嗙殑鎺т歡, 鏀寔鏂囨湰鍩熷拰杈撳叆妗? * @author hotleave */ function getPosition(obj){ //alert(obj.tagName); var result = 0; if(obj.selectionStart){ //闈濱E嫻忚鍣? result = obj.selectionStart }else{ //IE var rng; if(obj.tagName == "TEXTAREA"){ //濡傛灉鏄枃鏈煙 rng = event.srcElement.createTextRange(); rng.moveToPoint(event.x,event.y); }else{ //杈撳叆妗? rng = document.selection.createRange(); } rng.moveStart("character",-event.srcElement.value.length); result = rng.text.length; } return result; } function getValue(obj){ var pos = getPosition(obj); //alert(pos); alert(obj.value.substr(0,pos)+" [榪欓噷鏄坊鍔犵殑鍐呭] "+obj.value.substr(pos,obj.value.length)); } </script> </head> <body> <input type="text" value="浣犲ソ,Amethyst!" onmouseup="getValue(this)" style="display:block"> <textarea rows="6" cols="60" onmouseup="getValue(this)">Amethyst, 浣犲ソ.</textarea> </body> </html> </textarea><br /> <input id="0" onclick="runCode(this.id)" value="榪愯浠g爜" type="button" />  <button id="0" onclick="doCopy(this.id)">澶嶅埗浠g爜</button>  <label id="0" onclick="saveCode(this.id)" class="saveLabel">鍙﹀瓨浠g爜</label>  鎻愮ず錛氭?zhèn)? 鍙互鍏堜慨鏀歸儴鍒嗕唬鐮佸啀榪愯<br /> <br /> <br /> <textarea id="runcode1" class="codeTextarea" cols="60" rows="15"><html> <head> <title>js鑾峰彇鍏夋爣浣嶇疆</title> <style> body,td{ font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; } </style> <script type="text/javascript"> var start=0; var end=0; function add(){ var textBox = document.getElementById("ta"); var pre = textBox.value.substr(0, start); var post = textBox.value.substr(end); textBox.value = pre + document.getElementById("inputtext").value + post; } function savePos(textBox){ //濡傛灉鏄疐irefox(1.5)鐨勮瘽錛屾柟娉曞緢綆鍗? if(typeof(textBox.selectionStart) == "number"){ start = textBox.selectionStart; end = textBox.selectionEnd; } //涓嬮潰鏄疘E(6.0)鐨勬柟娉曪紝楹葷儲寰楀緢錛岃繕瑕佽綆椾笂'"n' else if(document.selection){ var range = document.selection.createRange(); if(range.parentElement().id == textBox.id){ // create a selection of the whole textarea var range_all = document.body.createTextRange(); range_all.moveToElementText(textBox); //涓や釜range錛屼竴涓槸宸茬粡閫夋嫨鐨則ext(range)錛屼竴涓槸鏁翠釜textarea(range_all) //range_all.compareEndPoints()姣旇緝涓や釜绔偣錛屽鏋渞ange_all姣攔ange鏇村線宸?further to the left)錛屽垯 //榪斿洖灝忎簬0鐨勫鹼紝鍒檙ange_all寰鍙崇Щ涓鐐癸紝鐩村埌涓や釜range鐨剆tart鐩稿悓銆? // calculate selection start point by moving beginning of range_all to beginning of range for (start=0; range_all.compareEndPoints("StartToStart", range) < 0; start++) range_all.moveStart('character', 1); // get number of line breaks from textarea start to selection start and add them to start // 璁$畻涓涓?n for (var i = 0; i <= start; i ++){ if (textBox.value.charAt(i) == '"n') start++; } // create a selection of the whole textarea var range_all = document.body.createTextRange(); range_all.moveToElementText(textBox); // calculate selection end point by moving beginning of range_all to end of range for (end = 0; range_all.compareEndPoints('StartToEnd', range) < 0; end ++) range_all.moveStart('character', 1); // get number of line breaks from textarea start to selection end and add them to end for (var i = 0; i <= end; i ++){ if (textBox.value.charAt(i) == '"n') end ++; } } } document.getElementById("start").value = start; document.getElementById("end").value = end; } </script> </head> <body> <form action="a.cgi"> <table border="1" cellspacing="0" cellpadding="0"> <tr> <td>start: <input type="text" id="start" size="3"/></td> <td>end: <input type="text" id="end" size="3"/></td> </tr> <tr> <td colspan="2"> <textarea id="ta" onKeydown="savePos(this)" onKeyup="this.value=this.value.replace(/["錛宂/g,',');savePos(this);" onmousedown="savePos(this)" onmouseup="savePos(this)" onfocus="savePos(this)" rows="14" cols="50"></textarea> </td> </tr> <tr> <td><input type="text" id="inputtext" /></td> <td><input type="button" onClick="add()" value="Add Text"/></td> </tr> </table> </form> </body> </html> </textarea><br /> <input id="1" onclick="runCode(this.id)" value="榪愯浠g爜" type="button" />  <button id="1" onclick="doCopy(this.id)">澶嶅埗浠g爜</button>  <label id="1" onclick="saveCode(this.id)" class="saveLabel">鍙﹀瓨浠g爜</label>  鎻愮ず錛氭?zhèn)? 鍙互鍏堜慨鏀歸儴鍒嗕唬鐮佸啀榪愯 <img src ="http://www.tkk7.com/sealyu/aggbug/324220.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/sealyu/" target="_blank">seal</a> 2010-06-22 23:17 <a href="http://www.tkk7.com/sealyu/archive/2010/06/22/324220.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title> FCKeditor: Resolve 鈥淔CKeditorAPI is not defined鈥?issuehttp://www.tkk7.com/sealyu/archive/2010/06/22/324103.htmlsealsealMon, 21 Jun 2010 16:12:00 GMThttp://www.tkk7.com/sealyu/archive/2010/06/22/324103.htmlhttp://www.tkk7.com/sealyu/comments/324103.htmlhttp://www.tkk7.com/sealyu/archive/2010/06/22/324103.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/324103.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/324103.htmlFCKeditor offers a complete JavaScript API so you can interact with it once the editor is loaded and running.

Once loaded, the editor registers a global object called FCKeditorAPI. This object offers the entry point to interact with any editor instance placed in a page.

NOTE: The FCKeditorAPI object will not be available during the page load. You need to wait for the editor to be loaded to use it.

Often, I see that people complain about a JavaScript error, “FCKeditorAPI is not defined”, when they try to use FCKeditorAPI.

For example

The following code will throw a JavaScript error when you try to use the FCKeditorAPI -

You can resolve the JavaScript error by adding a line of code (Line # 4) as shown below -

Hope this helps!



seal 2010-06-22 00:12 鍙戣〃璇勮
]]>
IE鍜孲afari涓噸鍛藉悕html鍏冪礌闇瑕佹敞鎰忕殑闂http://www.tkk7.com/sealyu/archive/2010/06/11/323288.htmlsealsealThu, 10 Jun 2010 16:10:00 GMThttp://www.tkk7.com/sealyu/archive/2010/06/11/323288.htmlhttp://www.tkk7.com/sealyu/comments/323288.htmlhttp://www.tkk7.com/sealyu/archive/2010/06/11/323288.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/323288.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/323288.html
榪欎袱澶╁湪澶勭悊嫻忚鍣ㄥ吋瀹圭殑鏃跺欑鍒板緢澶氶棶棰橈紝鐗瑰埆鏄湪閲嶆柊鍛藉悕checkbox鐨勬椂鍊欙紝鍦↖E鍜孲afari涓兘紕板埌涓浜涙紓鐨勯棶棰樸?br />
  1. IE涓笉鑳藉湪榪愯鏃墮噸鍛藉悕鍏冪礌銆?/li>
     鎸夌収寰蔣鐨勮В閲婏紝榪愯鏃舵槸鏃犳硶閲嶅懡鍚嶇殑錛?br />      After some digging, I found an explanation in the MSDN DHTML reference, on the page describing the NAME Attribute.

The NAME attribute cannot be set at run time on elements dynamically created with the createElement method. To create an element with a name attribute, include the attribute and value when using the createElement method.

鍚庢潵鎵懼埌鍥藉鐨勪竴綃囧笘瀛愶紝鎵懼埌涓涓В鍐蟲柟娉曪紝閭e氨鏄嬌鐢?a title="MSDN mergeAttributes Documentation" >mergeAttributes 鏂規(guī)硶錛屾ā鎷熸柊寤轟竴涓彧鏈塶ame涓嶅悓鐨勫厓绱狅紝騫跺拰涔嬪墠鐨勫厓绱犲悎騫訛紝榪欐牱灝辮兘杈懼埌閲嶅懡鍚嶇殑鏁堟灉浜嗐備唬鐮佸涓嬶細(xì)

var setElementName = function(el, newName) {

el 
= (typeof el === "string"? document.getElementById(el) : el;

el.name 
= newName;

if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { // Internet Explorer test 

el.mergeAttributes(document.createElement(
"<INPUT name='" + newName + "'/>"), false);

}

};

2. Safari涓紝濡傛灉鐢╣etElementsByName寰楀埌涓涓猚heckbox緇勶紝閭d箞閲嶅懡鍚嶇殑鏃? 鍊欙紝鏃犳硶鐢╢or寰幆鍏ㄩ儴閲嶅懡鍚?br /> 渚嬪錛?br />
var checkBoxes = document.getElementsByName("testCheckbox");
          
var checkBoxesSize = checkBoxes.length;
          
for (var i = checkBoxesSize - 1; i >= 0; i--) {
             
if (checkBoxes[i] && !checkBoxes[i].checked) {
                 setElementName(checkBoxes[i],
"testCheckbox-new");
             }
           }
榪欑鎯呭喌鍦↖E鍜孎irefox涓嬮潰閮芥病鏈夐棶棰橈紝鍏ㄩ儴鐨刢heckbox閮戒細(xì)琚垚鍔熺殑閲嶅懡鍚嶃?br /> 浣嗘槸鍦⊿afari涓嬮潰錛屾棤娉曞疄鐜拌繖涓洰鐨勩傜粡榪囪皟璇曞彂鐜幫紝鍦⊿afari涓紝濡傛灉浣跨敤getElementsByName鏉ュ緱鍒拌繖涓猚heckbox緇勶紝閭d箞鍦ㄩ噸鍛藉悕鐨勬椂鍊欙紝濡傛灉浣跨敤for寰幆鏉ヤ緷嬈¤繘琛岋紝閭d箞姣忛噸鍛藉悕涓涓猚heckbox錛宻afari灝嗚嚜鍔ㄥ皢榪欎釜鍏冪礌浠巉or寰幆涓Щ闄わ紝榪欐牱榪欎釜寰幆鍦ㄨ繘琛屽埌涓鍗婄殑鏃跺欏氨浼?xì)鎶ラ敊锛?xì)checkBoxes[i][null]涓嶆槸涓涓厓绱犮?br /> 綰犵粨浜嗕竴孌墊椂闂達(dá)紝鏈潵鎵撶畻鎯充竴涓畻娉曟潵瑙e喅榪欎釜闂錛屽悗鏉ョ獊鐒舵兂鍒板彟澶栦竴涓畝鍗曚竴鐐圭殑鏂規(guī)硶錛?br /> 浣跨敤getElementsByTagName鏂規(guī)硶鏉ュ緱鍒版墍鏈夊厓绱狅紝騫朵粠涓瓫閫夊嚭瀵瑰簲鐨刢heckbox錛屽鏋滅鍚堟潯浠訛紝鍐嶉噸鍛藉悕銆傝繖縐嶆儏鍐典笅錛屽洜涓轟嬌鐢ㄧ殑tag綾誨瀷鏉ヨ幏寰楃殑鏁扮粍錛屾墍浠ュ湪for寰幆涓紝鍦ㄩ噸鍛藉悕checkbox鍚庯紝safari灝變笉浼?xì)鑷姩鐨効U婚櫎瀵瑰簲鐨勫厓绱犮傚叿浣撲唬鐮佸涓嬶細(xì)

        
var elementlist = document.getElementsByTagName("input");
        
var elementSize = elementlist.length;
        
for(var i=0; i<elementSize;i++){
            
var curElement = elementlist[i];
            
if(curElement.type =='checkbox' && curElement.name == 'testCheckbox' && !curElement.checked){
                curElement.name
='testCheckbox-new';
            }
        }



seal 2010-06-11 00:10 鍙戣〃璇勮
]]>
prototype.js 鐨?Ajax.updater 鐨?鐢ㄦ硶(杞?http://www.tkk7.com/sealyu/archive/2010/06/10/323285.htmlsealsealThu, 10 Jun 2010 15:40:00 GMThttp://www.tkk7.com/sealyu/archive/2010/06/10/323285.htmlhttp://www.tkk7.com/sealyu/comments/323285.htmlhttp://www.tkk7.com/sealyu/archive/2010/06/10/323285.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/323285.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/323285.html(container, url, options)
鍒嗗埆琛ㄧず 1.鎺т歡id錛?.璇鋒眰鐨剈rl錛?.鍏蜂綋濡備笅錛堝彲閫夛級錛?/font>
灞炴?/th> 綾誨瀷 Default 鎻忚堪
method Array 'post' HTTP 璇鋒眰鏂瑰紡銆俫et or post
parameters String '' 鍦℉TTP璇鋒眰涓紶鍏ョ殑url鏍煎紡鐨勫煎垪琛ㄣ?/td>
asynchronous Boolean true 鎸囧畾鏄惁鍋氬紓姝?AJAX 璇鋒眰銆?/td>
postBody String undefined 鍦℉TTP POST鐨勬儏鍐典笅錛屼紶鍏ヨ姹備綋涓殑鍐呭銆?/td>
requestHeaders Array undefined 鍜岃姹備竴璧瘋浼犲叆鐨凥TTP澶撮儴鍒楄〃錛?榪欎釜鍒楄〃蹇呴』鍚湁鍋舵暟涓」鐩紝 浠諱綍濂囨暟欏圭洰鏄嚜瀹氫箟鐨勫ご閮ㄧ殑鍚嶇О錛? 鎺ヤ笅鏉ョ殑鍋舵暟欏圭洰浣胯繖涓ご閮ㄩ」鐩殑瀛楃涓插箋?渚嬪瓙:['my-header1', 'this is the value', 'my-other-header', 'another value']
onXXXXXXXX Function(XMLHttpRequest) undefined 鍦ˋJAX璇鋒眰涓紝褰撶浉搴旂殑浜嬩歡/鐘舵佸艦鎴愮殑鏃跺欒皟鐢ㄧ殑鑷畾涔夋柟娉曘?渚嬪 var myOpts = {onComplete: showResponse, onLoaded: registerLoaded};. 榪欎釜鏂規(guī)硶灝嗚浼犲叆涓涓弬鏁幫紝 榪欎釜鍙傛暟鏄惡甯JAX鎿嶄綔鐨?XMLHttpRequest瀵硅薄銆?/td>
onSuccess Function(XMLHttpRequest) undefined 褰揂JAX璇鋒眰鎴愬姛瀹屾垚鐨勬椂鍊欒皟鐢ㄧ殑鑷畾涔夋柟娉曘?榪欎釜鏂規(guī)硶灝嗚浼犲叆涓涓弬鏁幫紝 榪欎釜鍙傛暟鏄惡甯JAX鎿嶄綔鐨?XMLHttpRequest瀵硅薄銆?/td>
onFailure Function(XMLHttpRequest) undefined 褰揂JAX璇鋒眰瀹屾垚浣嗗嚭鐜伴敊璇殑鏃跺欒皟鐢ㄧ殑鑷畾涔夋柟娉曘?榪欎釜鏂規(guī)硶灝嗚浼犲叆涓涓弬鏁幫紝 榪欎釜鍙傛暟鏄惡甯JAX鎿嶄綔鐨?XMLHttpRequest瀵硅薄銆?/td>
insertion Function(Object, String) null 涓轟簡鎶婅繑鍥炵殑鏂囨湰娉ㄥ叆鍒頒竴涓厓绱犱腑鑰屾墽琛岀殑鏂規(guī)硶銆?榪欎釜鏂規(guī)硶灝嗚浼犲叆涓や釜鍙傛暟錛岃琚洿鏂扮殑瀵硅薄騫朵笖鍙簲鐢ㄤ簬 Ajax.Updater 瀵硅薄涓簲鐢ㄣ?/td>
decay Number undefined, 1 鍐沖畾褰撴渶鍚庝竴嬈″搷搴斿拰鍓嶄竴嬈″搷搴旂浉鍚屾椂鍦?function getContents() 

var request_url = "test1.html";       // 闇瑕佽幏鍙栧唴瀹圭殑url 
var request_pars = '';//璇鋒眰鍙傛暟 

var myAjax = new Ajax.Updater('result', request_url,{ // 灝唕equest_url榪斿洖鍐呭緇戝畾鍒癷d涓簉esult鐨勫鍣ㄤ腑 
method     : 'get'//HTTP璇鋒眰鐨勬柟娉?get or post 
parameters : request_pars, //璇鋒眰鍙傛暟 
onFailure  : reportError, //澶辮觸鐨勬椂鍊欒皟鐢?nbsp;reportError 鍑芥暟 
onLoading  : loading, //姝e湪鑾峰緱鍐呭鐨勬椂鍊?nbsp;
onComplete : done     //鍐呭鑾峰彇瀹屾瘯鐨勬椂鍊?nbsp;
}); 


function loading() 

$(
'loading').style.display = 'block'


function done() 

$(
'loading').style.display = 'none'


function reportError(request) 

alert(
'Sorry. There was an error.'); 
Ajax.Updater 涓烘垜浠彁渚涘姞杞芥枃妗f椂鍊欑殑涓夌鐘舵? onComplete,onLoading,onFailure.鎴戜滑鍙互鑷畾涔変竴涓嚱鏁板垎鍒浉搴旇繖涓夌涓嶅悓鐨勭姸鎬併?br /> 涓嬮潰鐨勪緥瀛愮敤鍒頒簡success (涓鍒嘜K鐨勬椂鍊欐墠琚敤鍒? 錛屽拰瀹冨悓絳夊湴浣嶇殑灞炴ц繕鏈変竴涓?font face="Courier New">failure (鏈夊湴鏂瑰嚭闂鐨勬椂鍊欒鐢ㄥ埌) 榪欓噷娌$敤鍒般傚嚭閿欐椂鍦?onFailure 澶勮皟鐢?reportError 鏂規(guī)硶銆?br />
<script>
    
function getHTML()
    {
        
var url = 'http://yourserver/app/getSomeHTML';
        
var pars = 'someParameter=ABC';
        
var myAjax = new Ajax.Updater(
                    {success: 
'placeholder'},
                    url,
                    {method: 
'get', parameters: pars, onFailure: reportError});
    }
    
function reportError(request)
    {
        alert(
'Sorry. There was an error.');
    }
</script>

<input type=button value=GetHtml onclick="getHTML()">
<div id="placeholder"></div>


seal 2010-06-10 23:40 鍙戣〃璇勮
]]>Detecting Internet Explorer More Effectivelyhttp://www.tkk7.com/sealyu/archive/2010/06/09/323114.htmlsealsealTue, 08 Jun 2010 20:35:00 GMThttp://www.tkk7.com/sealyu/archive/2010/06/09/323114.htmlhttp://www.tkk7.com/sealyu/comments/323114.htmlhttp://www.tkk7.com/sealyu/archive/2010/06/09/323114.html#Feedback2http://www.tkk7.com/sealyu/comments/commentRss/323114.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/323114.htmlThis topic demonstrates how to detect current and future versions of Windows Internet Explorer more effectively.

This topic contains the following sections.

Introduction

Many Web designers use browser detection techniques to ensure that their sites display properly when viewed with specific browsers. Some browser detection techniques encounter problems when viewed with later versions of the browser they're tailored for. For example, many Web designers used Cascading Style Sheets (CSS) rules that relied on the implementation of CSS in Microsoft Internet Explorer 6 to detect that version of the browser. When Internet Explorer 7 provided additional support for the CSS, Level 2 (CSS2) standard, many of these rules (also known as "CSS hacks") failed to detect the new version of the browser. As a result, sites that relied on these rules no longer displayed as intended. When using browser detection techniques, use techniques that support current and future versions of the browser you're targeting.

This topic examines four different ways to detect Internet Explorer and also provides a brief look at alternatives to browser detection. Advantages of each technique are reviewed and suggestions are offered for effective use. In addition, examples demonstrate techniques that support current and future versions of Internet Explorer.

Parsing the User-Agent String

The most common way to detect Internet Explorer is to use client-side scripting to parse the user-agent string and extract the version number from the version token. The following example shows the preferred way to do this with JavaScript.

function getInternetExplorerVersion()

// Returns the version of Internet Explorer or a -1

// (indicating the use of another browser).

{

var rv = -1; // Return value assumes failure.

if (navigator.appName == 'Microsoft Internet Explorer')

{

var ua = navigator.userAgent;

var re = new RegExp("MSIE ([0-9]{1,}[".0-9]{0,})");

if (re.exec(ua) != null)

rv = parseFloat( RegExp.$1 );

}

return rv;

}

function checkVersion()

{

var msg = "You're not using Internet Explorer.";

var ver = getInternetExplorerVersion();



if ( ver > -1 )

{

if ( ver >= 8.0 )

msg = "You're using a recent copy of Internet Explorer."

else

msg = "You should upgrade your copy of Internet Explorer.";

}

alert( msg );

}

As you review this example, please note the following:

  • A regular expression extracts the version number from the user-agent version token. Regular expressions let you specify optional conditions to match, so that you can match a larger number of version tokens, not just those that match a strict set of conditions.

  • The version number extracted from the version token is formally converted to a numeric value. Care must be taken because pre-release versions of Internet Explorer typically add letters to the version token. For example, the version token for pre-release versions of Internet Explorer 7 was "MSIE 7.0b."

  • The checkVersion() function verifies that the browser is version 8.0 or later. This ensures that the welcome message is displayed for those using newer versions of the browser.

This example properly detects most versions of Internet Explorer, but only if scripting is enabled. However, the user-agent string is dynamic; it can be changed by the end user, by browser extensions, and by operating system updates. As a result, there's no guarantee that the user-agent string accurately reflects the browser being used. The next sections show techniques that may be more effective alternatives.

Note  It is not recommended that you block access to content based on the user-agent string of the browser. If you do have to offer different content to different versions of the browser due to improved capabilities, you want to ensure that future versions of the browser are not blocked. Serving content based solely on the user-agent string is often an unreliable way to detect the full capabilities of the browser.

For more information about the user-agent string and Internet Explorer's user-agent tokens, see Understanding User-Agent Strings.

Using Conditional Comments

If you are specifically interested in Internet Explorer, conditional comments might be a more appropriate choice. The following example shows an effective way to use conditional comments to display custom content.

<!--[if gte IE 8]>

<p>You're using a recent version of Internet Explorer.</p>

<![endif]-->



<!--[if lt IE 7]>

<p>Hm. You should upgrade your copy of Internet Explorer.</p>

<![endif]-->



<![if !IE]>

<p>You're not using Internet Explorer.</p>

<![endif]>

Like the earlier JavaScript example, this example makes sure the current version is greater than or equal to a specified version number. This ensures that the content designed for the current version of the browser is properly displayed in a future version.

This example carefully combines downlevel-revealed and downlevel-hidden conditional comments to ensure that each message appears only for the intended browsers.

Because conditional comments do not rely on JavaScript, they are effective even if the user has disabled scripting. Unlike the user-agent string, conditional comments are typically updated when the browser is upgraded. This makes them more reliable than user-agent strings. However, because no other browser currently supports conditional comments, they are limited to Internet Explorer. Depending on your needs, this may be an advantage or a disadvantage.

For more information about conditional comments, see About Conditional Comments.

Detecting Features

For many Web sites, detecting a browser's features is the preferred form of browser detection because it allow the Web developer to focus on the general capabilities of a browser, rather than the specific details of each browser release. The following example demonstrates a simple form of feature detection.

if (XMLHttpRequest)

{

// This browser implements this feature.

}

Feature detection tends to support a broader range of browsers. In addition, should a browser implement the feature you're interested in, your content will be delivered without requiring changes to your browser detection technique. As a result, techniques that focus on features tend to require less maintenance than techniques that rely on environmental factors, such as the user-agent string. In addition, they tend to work across a wider variety of browser devices, including screen readers, mobile devices, and so on.

Use care when creating or using browser detection techniques that attempt to detect a browser based on unsupported functionality. If a future version of the browser implements the missing feature, it's entirely possible your site may not display as intended.

Using the ASP.NET HttpBrowserCapabilities Object

ASP.NET developers can use the HttpBrowserCapabilities object to detect and respond to almost any browser. In addition, alternate content is not sent to the end-user's browser. The following example shows how to detect Internet Explorer from an ASP.NET application using C#.

private float getInternetExplorerVersion()

{

// Returns the version of Internet Explorer or a -1

// (indicating the use of another browser).

float rv = -1;

System.Web.HttpBrowserCapabilities browser = Request.Browser;

if (browser.Browser == "IE")

rv = (float)(browser.MajorVersion + browser.MinorVersion);

return rv;

}



private void Page_Load(object sender, System.EventArgs e)

{

string msg;

double ver = getInternetExplorerVersion();

if (ver > 0.0)

{

if (ver >= 7.0)

msg = "You're using a recent version of Internet Explorer.";

else

msg = "You should upgrade your copy of Internet Explorer.";

}

else

msg = "You're not using Internet Explorer.";



Label1.Text = msg;

}

Because the HttpBrowserCapabilities object parses the user-agent string for you, you can use the MajorVersion and MinorVersion properties to determine the current version of the browser. Unlike the JavaScript examples, these properties are numeric; MajorVersion returns an integer value, and MinorVersion returns a double value. Depending on the language used to implement your ASP.NET application, however, you might still have to typecast these property values to the data type you're using. To illustrate, the C# example converts MajorValue to the floating point value returned by the function.

For more information about the HttpBrowserCapabilities object, see HOW TO: Determine the Browser Version in ASP.NET or Browser Sniffing in ASP.NET World Wide Web link.

Alternatives to Browser Detection

If you use browser detection because Internet Explorer doesn't appear to support a particular feature, an alternate approach may be more effective. Before implementing new (or revising existing) browser detection, it may be worthwhile to consider one of the following approaches to solve the underlying problem.

  • Internet Explorer allows Web developers to choose between various document compatibility modes that affect the way the browser interprets and displays content. If you are not seeing the results you expect, a different document compatibility mode may provide the results you seek. For more information, see Defining Document Compatibility.

    You may want to consider using the Developer Tools to preview your pages in different document compatibility modes or to experiment with different ways to achieve various visual and layout effects. It's entirely possible there's another way to accomplish the same result.

  • If the Document Object Model (DOM) doesn't support a feature that you need, you may be able to add the feature using DOM mutable prototypes.

  • If none of the previous suggestions apply, it may be worthwhile to consider using an alternate approach.

Summary

If you must detect the browsers that view your Web sites, follow effective practices: plan for future browser releases, convert values appropriately, and design techniques to fail gracefully. Doing so will reduce the long-term maintenance of your site and help ensure that your site functions properly when viewed with newer versions of Internet Explorer and other browsers.

Community Content
Annotations
Bad browser detection
Using "v to detect IE is a bad idea because this will not work if future versions of IE change this behavior. The officially supported detection methods should be used.

However this example from the article is misleading. Since other browsers don't support conditional comments [if !IE] results in comments that will show up in no browsers.
<![if !IE]>
<p>You're not using Internet Explorer.</p>
<![endif]>

How to detect IE8 using JavaScript
Check out:
http://blogs.msdn.com/giorgio/archive/2009/04/14/how-to-detect-ie8-using-javascript-client-side.aspx

Shortest way of detecting IE

More efficient way to detect any version of IE is

function isMSIE() {

return '"v' == 'v';

}


The JScript engine used in IE doesn't recognize and therefore escape vertical tabulation character while all other does.



seal 2010-06-09 04:35 鍙戣〃璇勮
]]>
Using the navigator object to detect client's browserhttp://www.tkk7.com/sealyu/archive/2010/06/09/323113.htmlsealsealTue, 08 Jun 2010 20:34:00 GMThttp://www.tkk7.com/sealyu/archive/2010/06/09/323113.htmlhttp://www.tkk7.com/sealyu/comments/323113.htmlhttp://www.tkk7.com/sealyu/archive/2010/06/09/323113.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/323113.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/323113.html Until one browser remains standing on the web (if ever), browser detection will continue to be part of any good JavaScripter's life. Whether you're gliding a div across the screen or creating an image rollover, it's fundamental that only relevant browsers pick up on your code. In this tutorial we'll probe the navigator object of JavaScript, and show how to use it to perform browser detection, whether the subject is Firefox, Internet Explorer 7, Opera, etc.

The navigator object

The navigator object was conceived back in the days when Netscape Navigator reined supreme. These days it serves as much as an irony of NS's diminished market share as way of probing browser information.

The navigator object of JavaScript contains the following core properties:

Properties Description
appCodeName The code name of the browser.
appName The name of the browser (ie: Microsoft Internet Explorer).
appVersion Version information for the browser (ie: 4.75 [en] (Win98; U)).
cookieEnabled Boolean that indicates whether the browser has cookies enabled.
language Returns the default language of the browser version (ie: en-US). NS and Firefox only.
mimeTypes[] An array of all MIME types supported by the client. NS and Firefox only.
platform[] The platform of the client's computer (ie: Win32).
plugins An array of all plug-ins currently installed on the client. NS and Firefox only.
systemLanguage Returns the default language of the operating system (ie: en-us). IE only.
userAgent String passed by browser as user-agent header. (ie: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1))
userLanguage Returns the preferred language setting of the user (ie: en-ca). IE only.

Let's see exactly what these properties reveal of the browser you're currently using:

appCodeName: Mozilla
appName: Netscape
appVersion: 5.0 (Windows; zh-CN)
userAgent: Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
platform: Win32

At a glance

At a glance at the above table, you may be swayed towards turning to the following two properties to do your browser detection bidding:

navigator.appName
navigator.appVersion

After all, you are trying to detect a browser's name and version right? However, they both will most likely mislead you. In browsers such as various versions of Netscape and Firefox, these two properties return simply "Netscape" for appName, and 5.0 for appVersion without any further distinction for Firefox and its version, and hence are pretty much useless in the real world. For example, in both Firefox 1.x and Firefox 2.x, these two properties return:

appName: Netscape

appVersion: 5.0 (Windows; en-US)

We need to turn to a property that's more thorough in its investigative work if we want more consistency and accuracy, and that turns out to be navigator.userAgent.

Detecting Firefox x.x

In Firefox 2.0.0.13 for example, the userAgent property reads:

UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13

The detail we're interested in apparently lies at the very end, or Firefox/2.0.0.13. Different versions of Firefox will contain a different version number, but the pattern is consistent enough. The part we're interested in occurs after the string "Firefox/", or the exact version number. There are many ways to get to it using either standard String or RegExp methods- I'm opting for the later here:

<script type="text/javascript">

if (/Firefox["/"s]("d+"."d+)/.test(navigator.userAgent)){ //test for Firefox/x.x or Firefox x.x (ignoring remaining digits);
 var ffversion=new Number(RegExp.$1) // capture x.x portion and store as a number
 if (ffversion>=3)
  document.write("You're using FF 3.x or above")
 else if (ffversion>=2)
  document.write("You're using FF 2.x")
 else if (ffversion>=1)
  document.write("You're using FF 1.x")
}
else
 document.write("n/a")

</script>

Output: You're using FF 3.x or above

Basically, I'm capturing just the versonMajor.versionMinor portion of the full version number of Firefox (ie: 2.0.0.13 becomes simply 2.0), and using that as basis to detect the various versions of Firefox. Delving any deeper, and the returned version may no longer be a number but a string (ie: 2.0.0), which makes numeric comparisons cumbersome.

Detecting IE x.x

In IE 7.0 for example, the userAgent property reads:

UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)

So the part we're interested in lies in the middle, or MSIE 7.0;. If you try a shortcut and use parseFloat on the entire string to get to the 7.0 portion, it won't work. This is due to the way parseFloat works- by returning the first number it encounters, which in this case is 4.0. Once again we need to use either standard String or RegExp methods again to get to the actual version number; below I'm using RegExp as well:

<script type="text/javascript">



if (/MSIE ("d+"."d+);/.test(navigator.userAgent)){ //test for MSIE x.x;

 var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number

 if (ieversion>=8)

  document.write("You're using IE8 or above")

 else if (ieversion>=7)

  document.write("You're using IE7.x")

 else if (ieversion>=6)

  document.write("You're using IE6.x")

 else if (ieversion>=5)

  document.write("You're using IE5.x")

}

else

 document.write("n/a")

</script>

Output: n/a

Detecting Opera x.x

Detecting Opera using the navigator object at first appears to be tricky business due to the browser's identity crisis. You see, Opera 8 and below by default identifies itself as IE6 (or lower) in the navigator object. Users can override this setting under "Edit Site Settings" in the toolbar to identify as Opera or even another browser instead. Starting in Opera 9, the browser regains its confidence and identifies by default as itself, Opera, though users can still modify this setting manually in the toolbar. The bottom line is, Opera can appear as either Opera, Internet Explorer, or another browser within a designated list in the navigator object.

Lets take a look at what navigator.userAgent in Opera 8.5 returns depending on what it has chosen to identify itself as (whether automatically or manually):

As IE6: Mozilla/4.0 (compatible; MSIE 6.0; Windows XP) Opera 8.5 [en]
As Moz5: Mozilla/5.0 (Windows XP; U) Opera 8.5 [en]
As Opera: Opera/8.5 (Windows XP; U) [en]

Notice how if it's set to identify as IE, MSIE 6.0 appears within the string, while if set to identify as Mozilla, Mozilla/5.0 appears instead. As Opera itself, Opera/8.5 appears. In all three cases, the one commonality that we can exploit to actually detect Opera and its true version regardless of which identify it's decided to take on is the string "Opera x.x" or "Opera/x.x" within navigator.userAgent. In other words, there are two versions of the target string we need to be aware of. With that said, here's how you might go about testing for a specific version of Opera, which turns out to be no different than the technique used for detecting, say, Firefox:

<script type="text/javascript">
//Note: userAgent in Opera9.24 WinXP returns: Opera/9.24 (Windows NT 5.1; U; en)
//         userAgent in Opera 8.5 (identified as IE) returns: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Opera 8.50 [en]
//         userAgent in Opera 8.5 (identified as Opera) returns: Opera/8.50 (Windows NT 5.1; U) [en]

if (/Opera["/"s]("d+"."d+)/.test(navigator.userAgent)){ //test for Opera/x.x or Opera x.x (ignoring remaining decimal places);
 var oprversion=new Number(RegExp.$1) // capture x.x portion and store as a number
 if (oprversion>=10)
  document.write("You're using Opera 10.x or above")
 else if (oprversion>=9)
  document.write("You're using Opera 9.x")
 else if (oprversion>=8)
  document.write("You're using Opera 8.x")
 else if (oprversion>=7)
  document.write("You're using Opera 7.x")
 else
  document.write("n/a")
}
else
 document.write("n/a")
</script>

Output: n/a

Conclusion

We've seen how to use navigator to detect the browser type of your visitors. If the potential pitfalls and complexity of usage of it is a little too much for you, an alternative is to use Object Detection. Whichever method you choose, just be sure to choose one!



seal 2010-06-09 04:34 鍙戣〃璇勮
]]>
IE 鍜?Firefox涓彇寰梒reateRange()鐨勮搗鐐瑰拰緇堢偣鐨勫?/title><link>http://www.tkk7.com/sealyu/archive/2010/06/08/323099.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Tue, 08 Jun 2010 14:23:00 GMT</pubDate><guid>http://www.tkk7.com/sealyu/archive/2010/06/08/323099.html</guid><wfw:comment>http://www.tkk7.com/sealyu/comments/323099.html</wfw:comment><comments>http://www.tkk7.com/sealyu/archive/2010/06/08/323099.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/sealyu/comments/commentRss/323099.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/sealyu/services/trackbacks/323099.html</trackback:ping><description><![CDATA[<html><br /> <head><br /> <title>TEST</title><br /> <style><br /> body,td{<br />     font-family: verdana, arial, helvetica, sans-serif;<br />     font-size: 12px;<br /> }<br /> </style><br /> <script type="text/javascript"><br />     var start=0;<br />     var end=0;<br />     function add(){       <br />         var textBox = document.getElementById("ta");<br />         var pre = textBox.value.substr(0, start);<br />         var post = textBox.value.substr(end);<br />         textBox.value = pre + document.getElementById("inputtext").value + post;<br />     }<br />     function savePos(textBox){<br />         //濡傛灉鏄疐irefox(1.5)鐨勮瘽錛屾柟娉曞緢綆鍗?br />         if(typeof(textBox.selectionStart) == "number"){<br />             start = textBox.selectionStart;<br />             end = textBox.selectionEnd;<br />         }<br />         //涓嬮潰鏄疘E(6.0)鐨勬柟娉曪紝楹葷儲寰楀緢錛岃繕瑕佽綆椾笂'"n'<br />         else if(document.selection){<br />             var range = document.selection.createRange();<br />             if(range.parentElement().id == textBox.id){<br />                 // create a selection of the whole textarea<br />                 var range_all = document.body.createTextRange();<br />                 range_all.moveToElementText(textBox);<br />                 //涓や釜range錛屼竴涓槸宸茬粡閫夋嫨鐨則ext(range)錛屼竴涓槸鏁翠釜textarea(range_all)<br />                 //range_all.compareEndPoints()姣旇緝涓や釜绔偣錛屽鏋渞ange_all姣攔ange鏇村線宸?further to the left)錛屽垯                //榪斿洖灝忎簬0鐨勫鹼紝鍒檙ange_all寰鍙崇Щ涓鐐癸紝鐩村埌涓や釜range鐨剆tart鐩稿悓銆?br />                 // calculate selection start point by moving beginning of range_all to beginning of range<br />                 for (start=0; range_all.compareEndPoints("StartToStart", range) < 0; start++)<br />                     range_all.moveStart('character', 1);<br />                 // get number of line breaks from textarea start to selection start and add them to start<br />                 // 璁$畻涓涓?n<br />                 for (var i = 0; i <= start; i ++){<br />                     if (textBox.value.charAt(i) == '\n')<br />                         start++;<br />                 }<br />                 // create a selection of the whole textarea<br />                  var range_all = document.body.createTextRange();<br />                  range_all.moveToElementText(textBox);<br />                  // calculate selection end point by moving beginning of range_all to end of range<br />                  for (end = 0; range_all.compareEndPoints('StartToEnd', range) < 0; end ++)<br />                      range_all.moveStart('character', 1);<br />                      // get number of line breaks from textarea start to selection end and add them to end<br />                      for (var i = 0; i <= end; i ++){<br />                          if (textBox.value.charAt(i) == '\n')<br />                              end ++;<br />                      }<br />                 }<br />             }<br />         document.getElementById("start").value = start;<br />         document.getElementById("end").value = end;<br />     }<br /> </script><br /> </head><br /> <body><br /> <form action="a.cgi"><br /> <table border="1" cellspacing="0" cellpadding="0"><br />     <tr><br />         <td>start: <input type="text" id="start" size="3"/></td><br />         <td>end: <input type="text" id="end" size="3"/></td><br />     </tr><br />     <tr><br />         <td colspan="2"><br />             <textarea id="ta" onKeydown="savePos(this)"<br />                               onKeyup="savePos(this)"<br />                               onmousedown="savePos(this)"<br />                               onmouseup="savePos(this)"<br />                               onfocus="savePos(this)"<br />                               rows="14" cols="50"></textarea><br />         </td><br />     </tr><br />     <tr><br />         <td><input type="text" id="inputtext" /></td><br />         <td><input type="button" onClick="add()" value="Add Text"/></td><br />     </tr><br /> </table><br /> </form><br /> </body><br /> </html><br /> <br /> 闄勶細(xì)IE 涓殑瀹氫箟錛?http://msdn.microsoft.com/en-us/library/ms535872%28VS.85%29.aspx<br /> http://msdn.microsoft.com/en-us/library/ms533042%28VS.85%29.aspx<br /> <img src ="http://www.tkk7.com/sealyu/aggbug/323099.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/sealyu/" target="_blank">seal</a> 2010-06-08 22:23 <a href="http://www.tkk7.com/sealyu/archive/2010/06/08/323099.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Setting the name attribute in IE's DOMhttp://www.tkk7.com/sealyu/archive/2010/06/04/322693.htmlsealsealThu, 03 Jun 2010 22:04:00 GMThttp://www.tkk7.com/sealyu/archive/2010/06/04/322693.htmlhttp://www.tkk7.com/sealyu/comments/322693.htmlhttp://www.tkk7.com/sealyu/archive/2010/06/04/322693.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/322693.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/322693.htmlAn old problem with IE is that you can't set the name attribute on form elements in the DOM directly. Fortunately there is a workaround to this issue using IE's mergeAttributes method. By creating a temporary named element acceptable by IE's createElement method, you can merge the name attribute into the element you desire, allowing you to name or rename an element. An example demo follows.

var setName = function(el, newName) {

el = (typeof el === "string") ? document.getElementById(el) : el;

el.name = newName;

if (/*@cc_on!@*/0) { // Internet Explorer test (needs to be modified for IE8)

el.mergeAttributes(document.createElement("<INPUT name='" + newName + "'/>"), false);

}

};

In Mootools 1.2.1:

var setName = function(elementId, newName) {

var el = (!!elementId) ? $(elementId) : null;

if (!elementId || !newName || !el) return;



el.set({ "name" : newName });

if (Browser.Engine.trident4 || Browser.Engine.trident5) {

el.mergeAttributes(document.createElement("<INPUT name='" + newName + "'/>"), false);

}

};

Demo:

Before OUTERHTML:

<INPUT id=renameTarget value="Set Random Name" type=submit>


seal 2010-06-04 06:04 鍙戣〃璇勮
]]>
Inserting at the cursor using JavaScripthttp://www.tkk7.com/sealyu/archive/2010/06/04/322689.htmlsealsealThu, 03 Jun 2010 19:12:00 GMThttp://www.tkk7.com/sealyu/archive/2010/06/04/322689.htmlhttp://www.tkk7.com/sealyu/comments/322689.htmlhttp://www.tkk7.com/sealyu/archive/2010/06/04/322689.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/322689.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/322689.htmlNOTE: I’ve released a set of JavaScript Quicktags (that implement this technique) under the LGPL license. Please look at this code as it has a variety of enhancements and bug fixes.

I discovered a real JavaScript gem in PHPMyAdmin this morning. They have code that inserts content into a <textarea> at the cursor position instead of just at the beginning/end of the content. This is something I thought wasn’t possible – I’m quite pleased I was wrong.

I’ll be glad to see this code spread quickly to web forms that use buttons to aid in styling text and inserting image and link tags. WordPress and other blog and web forum packages would really benefit from this. (PHPMyAdmin is GPL, so any other GPL app should be able to use their code directly with attribution).

Here is a quick look at a generic version of the technique:

function insertAtCursor(myField, myValue) {
//IE support
if (document.selection) {
myField.focus();
sel = document.selection.createRange();
sel.text = myValue;
}
//MOZILLA/NETSCAPE support
else if (myField.selectionStart || myField.selectionStart == '0') {
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
myField.value = myField.value.substring(0, startPos)
+ myValue
+ myField.value.substring(endPos, myField.value.length);
} else {
myField.value += myValue;
}
}
// calling the function
insertAtCursor(document.formName.fieldName, 'this value');
I guess when the mouse leaves the textarea, it still has a cursor position left over. This code uses that position just as you’d want it to.

seal 2010-06-04 03:12 鍙戣〃璇勮
]]>
15涓嬌鐢╦Query瀹炵幇鍥劇墖騫葷伅鐗囨晥鏋滅殑JS婧愮爜(杞?http://www.tkk7.com/sealyu/archive/2010/05/18/321222.htmlsealsealMon, 17 May 2010 18:02:00 GMThttp://www.tkk7.com/sealyu/archive/2010/05/18/321222.htmlhttp://www.tkk7.com/sealyu/comments/321222.htmlhttp://www.tkk7.com/sealyu/archive/2010/05/18/321222.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/321222.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/321222.htmljQuery浣滀負(fù)涓涓簲鐢ㄦ渶騫挎硾鐨凧avaScript妗嗘灦涔嬩竴錛岀涓夋柟寮鍙戣呬笉鏂湴涓哄叾寮鍙戝嚭鏂扮殑 jQuery 鎻掍歡搴旂敤錛屼粠鑰屼嬌寰梛Query鍙互甯姪鐢ㄦ埛瀹炵幇鍚勭鍚勬牱涓嶅悓瀵誨父鐨?Web 鏁堟灉錛屼綔涓烘渶甯鎬嬌鐢ㄧ殑鍥劇墖騫葷伅鐗囨晥鏋滄洿鏄痡Query鐨勫己欏癸紝鐪嬪畬鏈枃涓轟綘鏁寸悊鎺ㄨ崘鐨?5涓紭縐鐨刯Query鍥劇墖騫葷伅鐗?鐢誨粖鏁堟灉錛屼綘浼?xì)鏀惰庝h洿澶氥?/p>

15涓紭縐鐨刯Query鍥劇墖騫葷伅鐗?鐢誨粖鏁堟灉錛屽熀鏈兘宸茬粡鍖呭惈浜嗗師鎻掍歡鐨勫彂甯冨湴鍧銆佷嬌鐢ㄦ柟娉曞拰婧愪唬鐮佷笅杞姐?/p>

1錛孏allerific

Galleriffic 鏄嬌鐢? Mike Alsup 鐨?jQuery Cycle plugin 鍒涘緩鐨勫浘鐗囧睍紺烘晥鏋滐紝鍖呮嫭緙╃暐鍥俱佸浘鐗囨爣棰樺拰鎻忚堪絳夎緇嗗姛鑳斤紝鏄竴涓潪甯鎬笉閿欑殑楂樿川閲忕敾寤婄浉鍐屽睍紺哄伐鍏楓?/p>

2錛孼oomImage

zoomimage 錛屼互涓縐嶇嫭鍏烽瓍鍔涚殑鏂瑰紡灞曠ず鍥劇墖鏁堟灉銆傜緝鐣ュ浘閾炬帴鍦ㄦ湰欏靛脊鍑哄ぇ鍥撅紝騫朵笖鍙互鍙互闅忔剰鎷栨嫿璇ユ?zhèn)瑡巩鍥剧墖銆?/p>

3錛孍asySlider

Easy Slider 鍙互瀹炵幇鍥劇墖鎴栧叾浠栦換鎰忓唴瀹癸紝鍦ㄦ按騫蟲垨鍨傜洿鏂瑰悜涓婄殑婊戝姩鏁堟灉錛屼綘榪樺彲浠ラ氳繃 CSS 鑷畾涔夎緗牱寮忋?/p>

4錛孴he Slider from Barack Obama’s website

涓涓簮鑷編鍥芥葷粺 Barack Obama 緗戠珯鐨勫瀭涓嬫粦鍔ㄨ彍鍗曟帶鍒剁殑鍥劇墖騫葷伅鏁堟灉銆?/p>

5錛孋odaSlider

CodaSlider錛? 鍙堜竴涓笉閿欑殑婊戝姩鎺у埗鏁堟灉銆?/p>

6錛宩Query Slider II

jQuery Slider II 鐨勫竷灞闈炲父絎﹀悎鎿嶄綔涔?fàn)鎯Q屽湪搴曢儴鍒楀嚭甯︽粴鍔ㄦ潯鐨勭緝鐣ュ浘鎺у埗鍒楄〃錛岀劧鍚庡湪涓婇潰鏄劇ず瀵瑰簲鍥劇墖鐨勫ぇ鍥炬祻瑙堬紝闈炲父閫傚悎鍋氶珮綰х浉鍐屻?/p>

7錛孊eautiful Slider

Beautiful Slider錛? 鍏夌湅榪欎釜鏁堟灉鍥句綘灝辯煡閬撹繖涓彃浠舵湁澶氭浜嗗惂錛屾槸鐨勶紝榪欎釜鎻掍歡瀹炵幇鐨勬晥鏋滃凡緇忎笉閫婅壊浜嶧lash瀹屾垚鐨勬晥鏋滐紝鏁翠綋琛ㄧ幇嫻佺晠錛屾枃瀛楁樉紺烘晥鏋滄洿鏄垱鎰忕嫭鐗廣?/p>

錛橈紝LoopedSlider

loopedSlider鏄張涓涓換鎰忓唴瀹規(guī)粴鍔? 鍒囨崲鐨勫夠鐏墖鎻掍歡錛屼嬌鐢ㄦ搷浣滅畝鍗曘?/p>

9錛孲paceGallery

Accessible news slider

SpaceGallery鏄竴涓叏鏂扮殑jQuery鎻掍歡錛岀偣鍑誨綋 鍓嶅浘鐗囷紝浼?xì)鑷姩鏀惧ぇ娑堝け锛屽悓鏃跺悗闈㈢殑鍥剧墖鍚戝墠灞暯C猴紝鏈変竴縐嶆椂鍏夋満鍣ㄧ殑鎰熻銆?/p>

10錛宩Query Popeye

11錛孨oobslide

Noobslide

12錛孉ccessible News Slider

Accessible news slider

13錛孲moothGallery

SmoothGallery

SmoothGallery鏄竴涓渶濂界殑 Javascript 騫葷伅鐗囨晥鏋滀箣涓錛屽彲浠ュ疄鐜板悇縐嶄笉鍚岀殑騫葷伅鐗囪漿鎹㈡晥鏋溿?/p>

14錛宩Query Multimedia Portfolio

jQuery Multimedia Portfolio

jQuery Multimedia Portfolio鏄竴涓熀浜巎Query 鐨勬粦鍔ㄦ晥鏋滄彃浠?闄や簡鍙互灞曠ず鍥劇墖涔嬪錛岃繕鍙互鍔犲叆鍚勭涓嶅悓綾誨瀷鐨勫濯掍綋鏂囦歡銆?/p>

15錛宻3Slider

s3Slider鏄竴涓潪甯哥畝鍗曞疄鐢ㄧ殑嫻佺晠騫葷伅鐗囨晥鏋滐紝榪欎釜 鎻掍歡琚簲鐢ㄥ湪鏃犳暟鐨刉ordPress涓撲笟涓婚妯℃澘涓?/p>

seal 2010-05-18 02:02 鍙戣〃璇勮
]]>
javascript 瀛楃涓插鐞嗗叏鏀葷暐(杞?http://www.tkk7.com/sealyu/archive/2010/04/15/318462.htmlsealsealThu, 15 Apr 2010 15:47:00 GMThttp://www.tkk7.com/sealyu/archive/2010/04/15/318462.htmlhttp://www.tkk7.com/sealyu/comments/318462.htmlhttp://www.tkk7.com/sealyu/archive/2010/04/15/318462.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/318462.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/318462.html

javascript 瀛楃涓插鐞?/strong>

鏂囩珷鏉ユ簮錛?a target="_blank">http://lmgq.vip.sina.com/tech/jsadvancedlesson/c2p1.htm

涓銆佸0鏄庡瓧絎︿覆:
var normal_monkey = "I am a monkey!<br>";
document.writeln("Normal monkey " + normal_monkey);

var bold_monkey = normal_monkey.bold();
document.writeln("Bold monkey " + bold_monkey);

榪欓噷鐨勫0鏄庯細(xì) var bold_monkey = normal_monkey.bold();
鍜屼笅闈㈠澹版槑鏄瓑鍚岀殑錛?nbsp;
var bold_monkey = "<b>" + normal_monkey + "</b>";

絎?涓増鏈殑澹版槑鐪嬭搗鏉ヨ綆鏄庡緱澶氥傝繖閲岀敤鍒頒簡瀛楃涓插璞′腑
鐨刡old瀵硅薄錛屽叾浠栫殑瀛楃涓插璞¤繕鏈塱ndexOf, charAt, 
substring, 浠ュ強(qiáng)split, 榪欎簺鏂規(guī)硶鍙互娣卞叆瀛楃涓茬殑緇勬垚緇撴瀯銆?br /> 棣栧厛鎴戜滑鐮旂┒涓涓媔ndexOf銆?/p>

2銆乮ndexOf
indexOf鐢ㄤ簬鍙戠幇涓緋誨垪鐨勫瓧絎﹀湪涓涓瓧絎︿覆涓瓑浣嶇疆騫跺憡璇変綘瀛愬瓧絎︿覆鐨勮搗濮嬩綅緗傚

鏋滀竴涓瓧絎︿覆涓儴鍖呭惈璇ュ瓙瀛楃涓插垯indexOf榪斿洖returns "-1."
渚嬪瓙錛?br /> var the_word = "monkey"; 
 //璁╂垜浠粠鍗曡瘝 "monkey"寮濮嬨?nbsp;
var location_of_m = the_word.indexOf("m"); 
 //location_of_m(瀛楁瘝m鐨勪綅緗?灝嗕負(fù)0錛屽洜涓哄瓧姣峬浣嶄簬璇ュ瓧絎︿覆鐨勮搗濮嬩綅緗?br /> var location_of_o = the_word.indexOf("o"); 
 //location_of_o(瀛楁瘝o鐨勪綅緗?灝嗕負(fù)1銆?br /> var location_of_key = the_word.indexOf("key"); 
 //location_of_key(key鐨勪綅緗?灝嗕負(fù)3鍥犱負(fù)瀛愬瓧絎︿覆“key”浠ュ瓧姣峩寮濮嬶紝鑰宬

鍦ㄥ崟璇峬onkey涓殑浣嶇疆鏄?銆?br /> var location_of_y = the_word.indexOf("y"); 
 //location_of_y)瀛楁瘝y鐨勪綅緗?鏄?銆?nbsp;
var cheeky = the_word.indexOf("q"); 
 //cheeky鍊兼槸-1錛屽洜涓哄湪鍗曡瘝“monkey”涓病鏈夊瓧姣峲銆?/p>

indexOf鏇村疄鐢ㄤ箣澶?
var the_email = prompt("What’s your email address?", "");
var the_at_is_at = the_email.indexOf("@");
if (the_at_is_at == -1)
{
    alert("You loser, email addresses must 
    have @ signs in them.");
}

榪欐浠g爜璇㈤棶鐢ㄦ埛鐨勭數(shù)瀛愰偖浠跺湴鍧錛屽鏋滅敤鎴瘋緭鍏ョ殑鐢?shù)瀛愰偖錃g鍦板潃涓笉鍖呭惈瀛楃 鍒?nbsp;鎻?/p>

紺虹敤鎴鳳紓錛犱綘杈撳叆鐨勭數(shù)瀛愰偖浠跺湴鍧鏃犳晥錛岀數(shù)瀛愰偖浠剁殑鍦板潃蹇呴』鍖呭惈瀛楃@銆傦紓

3銆乧harAt 
chatAt鏂規(guī)硶鐢ㄤ簬鍙戠幇涓涓瓧絎︿覆涓煇涓壒瀹氫綅緗殑瀛楃銆?br /> 榪欓噷鏄竴涓緥瀛愶細(xì)
var the_word = "monkey";
var the_first_letter = the_word.charAt(0);
var the_second_letter = the_word.charAt(1);
var the_last_letter = the_word.charAt(the_word.length-1);

the_first_letter(絎?涓瓧絎?鏄?m"
the_second_letter(絎?涓瓧絎?鏄?o"
the_last_letter(鏈鍚庝竴涓瓧絎?鏄?nbsp;"y"

娉ㄦ剰鍒╃敤瀛楃涓茬殑length(闀垮害)灞炴т綘鍙互鍙戠幇鍦ㄥ寘鍚灝戜釜瀛楃銆傚湪鏈緥涓紝

the_word鏄?monkey"錛屾墍浠he_word.length鏄?銆備笉瑕佸繕璁板湪涓涓瓧絎︿覆涓1涓瓧絎︾殑

浣嶇疆鏄?錛屾墍浠ユ渶鍚庝竴涓瓧絎︾殑浣嶇疆灝辨槸length-1銆傛墍浠ュ湪鏈鍚庝竴琛屼腑鐢ㄤ簡

the_word.length-1銆?gt;>

4銆佸瓙瀛楃涓詫紙substring錛?br /> 瀛愬瓧絎︿覆錛坰ubstring錛夊拰charAt鏈変簺璞★紝涓嶅悓涔嬪鍦ㄤ簬瀹冭兘澶熶粠涓涓崟璇嶄腑鎶撳彇鏁翠釜鐨?/p>

瀛愬瓧絎︿覆錛岃屼笉鍙槸瀛楁瘝錛岃繖閲屾槸鍏舵牸寮忥細(xì)

var the_substring = the_string.substring(from, to);

"From"鎸囩殑鏄瓙瀛楃涓蹭腑絎紤涓瓧姣嶇殑浣嶇疆錛?to"鏈夌偣濂囩壒錛屽畠鏄瀛愬瓧絎︿覆涓瘮鏈鍚?/p>

涓涓綅緗ぇ錛戠殑浣嶇疆錛庝嬌鐢ㄨ繖縐嶇濂囩殑鏂規(guī)硶浣犲彲浠ユ爣璁板瓙瀛楃涓茬殑璧峰鍜岀粨鏉熶綅緗紝鐢?/p>

"to"鐨勪綅緗噺鍘?from"鐨勪綅緗氨浼?xì)寰楀國櫙ュ瓙瀛椊W︿覆鐨勯暱搴︼細(xì)

var the_string = "monkey";
var clergy = the_string.substring(0,4);
var tool = the_string.substring(3,6);

榪愯璇ユ浠g爜鍚庡彉閲廲lergy鐨勫間負(fù)"monk"; 鍙橀噺tool鐨勫間負(fù)"key"銆?/p>

瀛愬瓧絎︿覆甯稿拰indexOf涓璧蜂嬌鐢紝灝嗗瓧絎︿覆鍒嗘垚鑻ュ共鍧楋紟渚嬪錛?br /> 浣犲彲浠ヤ粠涓涓粰瀹氱殑URL涓娊鍙栧嚭鍏跺煙鍚嶏細(xì)

var the_url = prompt("What’s the URL?","");
var lead_slashes = the_url.indexOf("http://");
var domain_start = lead_slashes + 2;
var without_resource = the_url.substring(domain_start, the_url.length);
var next_slash = without_resource.indexOf("/");
var domain = without_resource.substring(0, next_slash);

榪欐浠g爜鐨勬剰鎬濇槸錛氬鏋滀綘杈撳叆
"http://www.webmonkey.com/javascript/index.html";錛屽垯鍩熷悕 灝辨槸

"www.webmonkey.com" 錛庡鏋滆繖涓柟娉曞浣犳潵璇存湁浜涢夯鐑︼紝鎴戝皢鍚戜綘浠嬬粛濡備綍浣跨敤split

鏂規(guī)硶綆鍖栧叾鎵ц榪囩▼錛庝絾鏄鍏堟垜浠綔涓浜涘垎鏋愶紟

鍩烘湰鐨勬妧宸ф槸灝嗙錛戜釜鏂滄潬鍜岀錛掍釜鏂滄潬涔嬮棿鐨勫唴瀹瑰垎紱誨嚭鏉ワ細(xì)
var the_url = prompt("What’s the URL?",""); 
//榪欒浠g爜鍚戠敤鎴瘋闂竴涓猆RL錛庡亣璁劇敤鎴瘋緭鍏ヤ簡
"http://www.webmonkey.com/javascript/index.html."
var lead_slashes = the_url.indexOf("http://"); 
榪欒浠g爜紜畾絎竴涓弻鏂滄潬鐨勪綅緗紟鍦ㄦ湰渚嬩腑lead_slashes鐨勫兼槸錛曪紝鍥犱負(fù)鍙屾枩鏉犵殑浣?/p>

緗粠錛曞紑濮嬶紟

浣犲彲鑳戒細(xì)鎯籌紝閫氬父鐨刄RL閮芥槸浠ttp://寮濮嬶紝鎵浠ュ弻鏂滄潬鐨勪綅緗偗瀹氭槸鍦紩寮濮嬶紝涓轟粈

涔堣繕瑕佸姞鍏ndexOf榪欎竴孌靛浣欑殑浠g爜鍛紵浣嗘槸闂鐨勫叧閿湪浜庝綘涓嶇煡閬撶敤鎴峰湪濉叆URL

鏃舵槸鍚︿竴瀹氬~鍏ttp:錛屼粬浠篃璁鎬細(xì)涓嶅皬蹇冨閿叆浜嗕竴涓┖鏍鹼紝涔熻浠栦滑鎵閿叆鐨刄RL鍦?/p>

涓涓姞瀵嗘湇鍔″櫒涓婏紝鍏禪RL鏄?https://www.whatever.com/"; 錛? 鍦ㄧ紪紼嬩綘蹇呴』棰勬枡鍒扮縐?/p>

鍙兘鍙戠敓鐨勯棶棰橈紟鎵浠ユ垜浠繀欏葷敤indexOf鏂規(guī)硶紜畾鍙屾枩鏉犵殑紜垏鐨勮搗濮嬩綅緗紟

var domain_start = lead_slashes + 2; 

榪欒浠g爜鐢ㄤ簬璁$畻璇ュ煙鍚嶇殑絎紤涓瓧姣嶇殑璧峰浣嶇疆錛庣敱浜庤繖閲屾湁涓涓弻鏂滄潬錛屾墍浠ュ煙鍚?/p>

絎紤涓瓧姣嶇殑璧峰浣嶇疆搴旇鍦ㄥ弻鏂滄潬鎵鍦ㄤ綅緗姞錛掔殑浣嶇疆錛?/p>

var without_resource = the_url.substring(domain_start, the_string.length); 

榪欐浠g爜灝嗗煙鍚嶈搗濮嬩綅緗線鍚庣殑鎵鏈夊瓧絎﹂兘鎻愬彇鍑烘潵錛庢墍浠ユ墽琛屽畬榪欒浠g爜鍚?/p>

without_resource鏄?www.webmonkey.com/javascript/index.html." 

var next_slash = without_resource.indexOf("/"); 

榪欒浠g爜璁$畻鍑鴻瀛楃涓蹭腑涓嬩竴涓枩鏉犵殑浣嶇疆錛岃屼粠璇ュ瓧絎︿覆璧峰浣嶇疆鍒拌繖涓枩鏉犱箣闂?/p>

鐨勫唴瀹瑰氨鏄煙鍚嶏紟鍦ㄦ湰渚嬩腑涓嬩竴涓枩鏉犵殑浣嶇疆鏄?7銆?/p>

var domain = without_resource.substring(0, next_slash); 

鏈鍚庝竴姝ユ槸鎻愬彇鍑鴻瀛楃涓茶搗濮嬩綅緗埌涓嬩竴涓枩鏉犱箣闂寸殑鎵鏈夊唴瀹癸紟鍦ㄦ湰渚嬩腑浣垮緱鍩熷悕

絳夊悓浜?www.webmonkey.com"銆?/p>

榪欐牱鍋氱‘瀹炲緢楹葷儲錛屽埄鐢╯plit鏂規(guī)硶鍒欏彲浠ヤ嬌璇ヨ繃紼嬪鏄撳緢澶氾紟>>

5銆佸垎鍓叉柟娉?splitting method) 
浣犲彲浠ヤ嬌鐢╯plit鏂規(guī)硶鐢ㄩ檺浣嶅櫒鏉ュ垎鍓蹭竴緋誨垪鐨勫悕縐幫紝鐒跺悗灝嗗叾
鏀懼湪涓涓暟緇勪腑錛庝緥濡傦細(xì)

var my_friends ="trixie,moxie,sven,guido,hermes";

var friend_array =my_friends.split(",");

for (loop=0; loop < friend_array.length;loop++)
{    document.writeln(friend_array[loop] + " is myfriend.<br>");}

榪欐浠g爜灝嗗瓧絎︿覆my_friends鍒嗗壊鎴愬寘鍚紩涓厓绱犵殑鏁扮粍錛嶫avaScript鍙互涓轟綘鑷姩寤?/p>

绔嬩竴涓暟緇勶紝鎵浠ヤ綘鏃犻渶浣跨敤new Array()錛?/p>

灝嗗瓧絎︿覆鍒嗗壊鎴愭暟緇勪箣鍚庯紝鎴戜滑浣跨敤浜嗗驚鐜鍙ュ啓鍑烘瘡涓涓悕縐幫紟鎴戜滑鍙互鍒╃敤split鏂?/p>

娉曠畝鍖栧墠闈㈡墍璁插埌鐨勫煙鍚嶆彁鍙栵細(xì)

var the_url = prompt("What’s the URL?","");
var first_split = the_url.split("http://");
var without_resource = first_split[1];
var second_split = without_resource.split("/");
var domain = second_split[0];

榪欐浠g爜綆鍖栦簡寰堝鑰屼笖涔熸洿瀹規(guī)槗鐞嗚В錛庢垜浠潵鍒嗘瀽涓浜涜繖孌典唬鐮侊細(xì)

var the_url = prompt("What’s the URL?",""); 

鎻愮ず鐢ㄦ埛杈撳叆涓涓猆RL錛屽亣璁劇敤鎴瘋緭鍏?br /> "http://www.webmonkey.com/javascript/index.html"; 錛?br /> var first_split = the_url.split("http://"); 
灝嗙敤鎴瘋緭鍏ョ殑瀛楃涓插垎鍓叉垚涓ゅ潡錛歠irst_split[0]鏄?http:"錛宖irst_split[1]鏄?/p>

"www.webmonkey.com/javascript/index.html." 
var without_resource = first_split[1]; 
//鎻愬彇鍑烘暟緇勪腑鐨勭錛掍釜鍏冪礌錛屾墍浠ョ幇鍦╳ithout_resource鏄?/p>

"www.webmonkey.com/javascript/index.html." 
var second_split = without_resource.split("/"); 
灝唚ithout_resource鍒嗗壊鎴愶紦鍧楋細(xì)www.webmonkey.com,javascript, 鍜宨ndex.html錛庣幇

鍦ㄤ綘鍙互鐪嬪埌split鐨勭敤閫斾簡鍚э紵

var domain = second_split[0]; 

鐜板湪鎴戜滑鎻愬彇鍑烘柊鏁扮粍涓殑絎紤涓厓绱犲氨鍙緱鍑哄煙鍚嶏紟



seal 2010-04-15 23:47 鍙戣〃璇勮
]]>
Javascript: setTimeout()浣跨敤鍙?setInterval()浣跨敤http://www.tkk7.com/sealyu/archive/2009/12/24/307165.htmlsealsealThu, 24 Dec 2009 07:43:00 GMThttp://www.tkk7.com/sealyu/archive/2009/12/24/307165.htmlhttp://www.tkk7.com/sealyu/comments/307165.htmlhttp://www.tkk7.com/sealyu/archive/2009/12/24/307165.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/307165.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/307165.html

Evaluates an expression after a specified number of milliseconds has elapsed.

(鍦ㄦ寚瀹氭椂闂磋繃鍚庢墽琛屾寚瀹氱殑琛ㄨ揪寮?


Syntax:

iTimerID = window.setTimeout(vCode, iMilliSeconds [, sLanguage])

Parameters

vCode Required. Variant that specifies the function pointer or string that indicates the code to be executed when the specified interval has elapsed.
iMilliSeconds Required. Integer that specifies the number of milliseconds.
sLanguage Optional. String that specifies one of the following values:
JScript Language is JScript.
VBScript Language is VBScript.
JavaScript Language is JavaScript.

Return Value

Integer. Returns an identifier that cancels the evaluation with the clearTimeout method.

==============================================================

浠ヤ笂鍐呭鎽樿嚜鏌愭湰JScript鏁欑▼(CHM鏍煎紡,鍑哄涓嶈,璺熷師浣滆呰澹癝orry)


浠ヤ笅鍐呭娌℃妱浠諱綍浜虹殑,濡傛灉鏈夐浄鍚?浼拌涓嶆槸浣犳妱鍋剁殑灝辨槸宸у悎,鍢垮樋.

-------------------------------------------------------------------
setTimeout( alert("3縐掔榪囧幓浜?), 3000);//璋冪敤涓涓嚱鏁?鍏佽甯﹀父閲忓弬鏁?br /> -------------------------------------------------------------------
<script language="Javascript">
//by zuoyang

var x = 1;
var y = 2;
var z = 3;

var sum;

function Plus(a, b)
{
          var z = 0;
          var i = 0;
          for (i = 0; i < arguments.length; i++)
          {
                   z += arguments[i];
          }
          setTimeout( function() {alert(z);}, 6000); //鍙互甯﹀彉閲忓弬鏁扮殑setTimeout璋冪敤褰㈠紡
          return z;
}

setTimeout( function(){ sum = Plus(x, y, z); }, 3000);/*闄や簡鍙互甯﹀彉閲忓弬鏁拌繕鍙互鑾峰彇榪斿洖鍊肩殑setTimeout璋冪敤褰㈠紡*/

</script>

setInterval()鐨勭敤娉曞拰setTimeout()鏄竴鏍風(fēng)殑:

iTimerID = window.setInterval(vCode, iMilliSeconds [, sLanguage])

涓嶅悓鐨勬槸setTimeout()鏄竴嬈℃т綔鐢?鑰宻etInterval()鏄瘡闅?em>iMilliSeconds灝辨墽琛屼竴嬈?em>vCode.(Evaluates an expression each time a specified number of milliseconds has elapsed)



seal 2009-12-24 15:43 鍙戣〃璇勮
]]>
javascript CDATA鐨勬剰涔?http://www.tkk7.com/sealyu/archive/2009/12/07/304961.htmlsealsealMon, 07 Dec 2009 02:04:00 GMThttp://www.tkk7.com/sealyu/archive/2009/12/07/304961.htmlhttp://www.tkk7.com/sealyu/comments/304961.htmlhttp://www.tkk7.com/sealyu/archive/2009/12/07/304961.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/304961.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/304961.htmlCDATA 鍐呴儴鐨勬墍鏈変笢瑗塊兘浼?xì)琚В鏋愬櫒蹇界暐銆?/p>

鍋囧鏂囨湰涓寘鍚簡澶ч噺鐨?"<" 鍜?"&" 瀛楃 - 灝卞儚緙栫▼浠g爜涓粡甯稿嚭鐜扮殑鎯呭喌涓鏍?- 閭d箞榪欎釜 XML 鍏冪礌灝卞彲浠ヨ瀹氫箟涓轟竴涓?CDATA 閮ㄥ垎銆?/p>

CDATA 鍖烘寮濮嬩簬 "<![CDATA["錛岀粨鏉熶簬 "]]>"錛?/p>

<script type="text/javascript">
<![CDATA[
function compare(a,b)
{
if (a < b)
   {alert("a灝忎簬b");}
else if (a>b)
   {alert("a澶т簬b");}
else
   {alert("a絳変簬b");}
}
]]>
</script>

鍦ㄤ笂闈㈢殑渚嬪瓙涓紝鍦?CDATA 鍖烘涓殑鎵鏈変笢瑗塊兘浼?xì)琚В鏋愬櫒蹇界暐銆?/p>


鍏充簬 CDATA 鍖烘鐨勬敞閲?

CDATA 鍖烘涓嶈兘鍖呭惈瀛楃涓?"]]>"錛屾墍浠ワ紝CDATA 鍖烘鐨勫祵濂楁槸涓嶈鍏佽鐨勩?/p>

鍚屾椂涔熼渶瑕佺‘淇濆湪 "]]>" 瀛楃涓蹭腑娌℃湁絀烘牸鎴栨姌琛屻?/p>

涓轟粈涔堣浣跨敤CDATA:

       XHTML鐨勭浜屼釜鏀瑰彉鏄嬌鐢–DATA孌點(diǎn)俋ML涓殑CDATA孌電敤浜庡0鏄庝笉搴旇瑙f瀽涓烘爣絳劇殑鏂囨湰錛圶HTML涔熸槸濡傛錛夛紝榪欐牱灝卞彲浠ヤ嬌鐢ㄧ壒孌婂瓧絎︼紝濡? 灝忎簬錛?lt;錛夈佸ぇ浜庯紙>錛夈佸拰鍙鳳紙&錛夊拰鍙屽紩鍙鳳紙"錛夛紝鑰屼笉蹇呬嬌鐢ㄥ畠浠殑瀛楃瀹炰綋銆傝冭檻涓嬮潰鐨勪唬鐮侊細(xì)

<script type="text/javascript">
function compare(a,b)
{
if (a < b)
   {alert("a灝忎簬b");}
else if (a>b)
   {alert("a澶т簬b");}
else
   {alert("a絳変簬b");}
}
</script>

榪欎釜鍑芥暟鐩稿綋綆鍗曪紝瀹冩瘮杈冩暟瀛梐鍜宐錛岀劧鍚庢樉紺烘秷鎭鏄庡畠浠殑鍏崇郴銆備絾鏄紝鍦╔HTML涓紝榪欐浠g爜鏄棤鏁堢殑錛屽洜涓哄畠浣跨敤浜嗕笁涓壒孌婄鍙鳳紝鍗沖皬浜庛? 澶т簬鍜屽弻寮曞彿銆傝淇榪欎釜闂錛屽繀欏誨垎鍒敤榪欎笁涓瓧絎︾殑XML瀹炰綋&lt;銆?amp;gt;鍜?amp;quot;鏇挎崲瀹冧滑錛?/p>

<script type="text/javascript">
function compare(a,b)
{
if (a &lt;b)
   {alert(&quot;a灝忎簬b&quot;);}  
else if (a&gt;b)
   {alert(&quot;a澶т簬b&quot;);}
else
   {alert(&quot;a絳変簬b&quot;);}
}
</script>

榪欐浠g爜瀛樺湪涓や釜闂銆傞鍏堬紝寮鍙戣呬笉涔?fàn)鎯敤XML瀹炰綋緙栧啓浠g爜銆傝繖浣夸唬鐮佸緢闅捐鎳傘傚叾嬈★紝鍦↗avaScript涓紝榪欑浠g爜瀹為檯涓婂皢瑙嗕負(fù)鏈夎娉? 閿欙紝鍥犱負(fù)瑙i噴紼嬪簭涓嶇煡閬揦ML瀹炰綋鐨勬剰鎬濄傜敤CDATA孌靛嵆鍙互浠ュ父瑙勫艦寮忥紙鍗蟲槗璇葷殑璇硶錛夌紪鍐橨avaScript浠g爜銆傛寮忓姞鍏DATA孌電殑鏂規(guī)硶濡? 涓嬶細(xì)

<script type="text/javascript">
<![CDATA[
function compare(a,b)
{
if (a < b)
   {alert("a灝忎簬b");}
else if (a>b)
   {alert("a澶т簬b");}
else
   {alert("a絳変簬b");}
}
]]>
</script>

铏界劧榪欐槸姝e紡鏂瑰紡錛屼絾榪樿璁頒綇錛屽ぇ澶氭暟嫻忚鍣ㄩ兘涓嶅畬鍏ㄦ敮鎸乆HTML錛岃繖灝卞甫鏉ヤ富瑕侀棶棰橈紝鍗寵繖鍦↗avaScript涓槸涓娉曢敊璇紝鍥犱負(fù)澶у鏁版祻瑙堝櫒榪樹笉璁よ瘑CDATA孌點(diǎn)?/p>

<script type="text/javascript">
//<![CDATA[                                            
function compare(a,b)
{
if (a < b)
   {alert("a灝忎簬b");}
else if (a>b)
   {alert("a澶т簬b");}
else
   {alert("a絳変簬b");}
}
//]]>                                      
</script>

褰撳墠浣跨敤鐨勮В鍐蟲柟妗堟ā浠夸簡“瀵規(guī)棫嫻忚鍣ㄩ殣钘?#8221;浠g爜鐨勬柟娉曘備嬌鐢ㄥ崟琛岀殑JavaScript娉ㄩ噴"http://"錛屽彲鍦ㄤ笉褰卞搷浠g爜璇硶鐨勬儏鍐典笅宓屽叆CDATA孌碉細(xì)

鐜板湪錛岃繖孌典唬鐮佸湪涓嶆敮鎸乆HTML鐨勬祻瑙堝櫒涓篃鍙繍琛屻?/p>

浣嗘槸錛屼負(fù)閬垮厤CDATA鐨勯棶棰橈紝鏈濂借繕鏄敤澶栭儴鏂囦歡寮曞叆JavaScript浠g爜銆?/p>

seal 2009-12-07 10:04 鍙戣〃璇勮
]]>
娣卞叆璁よ瘑javascript涓殑eval鍑芥暟(杞?http://www.tkk7.com/sealyu/archive/2009/05/19/271465.htmlsealsealTue, 19 May 2009 02:10:00 GMThttp://www.tkk7.com/sealyu/archive/2009/05/19/271465.htmlhttp://www.tkk7.com/sealyu/comments/271465.htmlhttp://www.tkk7.com/sealyu/archive/2009/05/19/271465.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/271465.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/271465.html 錛?錛変粙緇峧avascript涓殑eval鍑芥暟鐨勭敤娉?br /> 錛?錛夊浣曞湪鍑芥暟鍐呮墽琛屽叏灞浠g爜
鈻哄厛鏉ヨeval鐨勭敤娉曪紝鍐呭姣旇緝綆鍗曪紝鐔熸?zhèn)夌殑鍙互锜q囥?br /> eval鍑芥暟鎺ユ敹涓涓弬鏁皊錛屽鏋渟涓嶆槸瀛楃涓詫紝鍒欑洿鎺ヨ繑鍥瀞銆傚惁鍒欐墽琛宻璇彞銆傚鏋渟璇彞鎵ц緇撴灉鏄竴涓鹼紝鍒欒繑鍥炴鍊鹼紝鍚﹀垯榪斿洖undefined銆?br /> 闇瑕佺壒鍒敞鎰忕殑鏄璞″0鏄庤娉?#8220;{}”騫朵笉鑳借繑鍥炰竴涓鹼紝闇瑕佺敤鎷彿鎷搗鏉ユ墠浼?xì)杩斿洖鍊鹼紝綆鍗曠ず渚嬪涓嬶細(xì)
var code1='"a" + 2';    //琛ㄨ揪寮?br /> var code2='{a:2}';      //璇彞
alert(eval(code1));     
//->'a2'
alert(eval(code2));     
//->undefined
alert(eval('(' + code2 + ')'));    //->[object Object]
        鍙互鐪嬪埌錛屽浜庡璞″0鏄庤鍙ユ潵璇達(dá)紝浠呬粎鏄墽琛岋紝騫朵笉鑳借繑鍥炲箋備負(fù)浜嗚繑鍥炲父鐢ㄧ殑“{}”榪欐牱鐨勫璞″0鏄庤鍙ワ紝蹇呴』鐢ㄦ嫭鍙鋒嫭浣忥紝浠ュ皢鍏惰漿鎹負(fù)琛ㄨ揪寮忥紝鎵嶈兘榪斿洖鍏跺箋傝繖涔熸槸浣跨敤JSON鏉ヨ繘琛孉jax寮鍙戠殑鍩烘湰鍘熺悊涔嬩竴銆傚湪渚嬪瓙涓彲浠ユ竻妤氱殑鐪嬪埌錛岀浜屼釜alert璇彞杈撳嚭鐨勬槸undefined錛岃岀涓変釜鍔犱簡鎷彿鍚庤緭鍑虹殑鏄鍙ヨ〃紺虹殑瀵硅薄銆?/div>
            鈻虹幇鍦ㄦ潵璇存湰鏂囩殑閲嶇偣錛屽浣曞湪鍑芥暟鍐呮墽琛屽叏灞浠g爜銆備負(fù)浜嗚鏄庤繖涓棶棰橈紝鍏堢湅涓涓緥瀛愶細(xì)
var s='global';    //瀹氫箟涓涓叏灞鍙橀噺
function demo1(){
    eval('var s="local"');
}
demo1();
alert(s);    //->global
         寰堝ソ鐞嗚В錛屼笂闈㈢殑demo1鍑芥暟絳変環(huán)浜庯細(xì)function demo1(){var s='local';}錛屽叾涓畾涔変簡涓涓眬閮ㄥ彉閲弒銆?br />         鎵浠ユ渶鍚庣殑杈撳嚭鏄痝lobal騫朵笉鏄粈涔堝鎬殑浜嬫儏錛屾瘯绔熷ぇ瀹墮兘鑳藉緢娓呮鐨勫尯鍒嗗眬閮ㄥ彉閲忓拰鍏ㄥ眬鍙橀噺銆?br />         浠旂粏浣撲細(xì)涓涓嬶紝鍙互鍙戠幇eval鍑芥暟鐨勭壒鐐癸紝瀹冩繪槸鍦ㄨ皟鐢ㄥ畠鐨勪笂涓嬫枃鍙橀噺絀洪棿錛堜篃縐頒負(fù)錛氬寘錛宑losure錛夊唴鎵ц錛屾棤璁烘槸鍙橀噺瀹氫箟榪樻槸鍑芥暟瀹氫箟閮芥槸濡傛錛屾墍浠ュ涓嬬殑浠g爜浼?xì)漶旂敓鍑芥暟鏈畾涔夌殑閿欒锛?xì)
var s='function test(){return 1;}';     //涓涓嚱鏁板畾涔夎鍙?br /> function demo2(){
    eval(s);
}
demo2();
alert(test());    //->error:test is not defined
        榪欐槸鍥犱負(fù)test鍑芥暟鍦ㄥ眬閮ㄧ┖闂村畾涔夛紝demo2鍑芥暟鍐呭彲浠ヨ闂埌錛屽闈㈠氨璁塊棶涓嶅埌浜嗐?/div>

         鑰屽湪瀹為檯鐨凙jax寮鍙戜腑錛屾湁鏃舵垜浠渶瑕佷粠鏈嶅姟鍣ㄥ姩鎬佽幏鍙栦唬鐮佹潵鎵ц錛屼互鍑忚交涓嬈¤澆鍏ヤ唬鐮佽繃澶氱殑闂錛屾垨鑰呮槸涓浜涗唬鐮佹槸閫氳繃Javascript鑷韓鐢熸垚鐨勶紝甯屾湜鐢╡val鍑芥暟鏉ヤ嬌鍏舵墽琛屻?br /> 浣嗚繖鏍風(fēng)殑鍔ㄦ佽幏鍙栦唬鐮佺殑宸ヤ綔涓鑸湪鍑芥暟鍐呭畬鎴愶紝姣斿錛?/div>
function loadCode(){
    var code=getCode();
    eval(code);
}
       鍙eval涓嶅彲鑳藉湪鍏ㄥ眬絀洪棿鍐呮墽琛岋紝榪欏氨緇欏紑鍙戝甫鏉ヤ簡涓嶅皯闂錛屼篃鐪嬪埌榪囧緢澶氫漢涓烘閮侀椃銆?/div>
        涓嶈繃鐜板湪鍋剁粓浜庢壘鍒頒簡瑙e喅鍔炴硶錛屽樋鍢匡紝鍙互鍚屾椂鍏煎IE鍜孎irefox錛屾柟娉曞涓嬶細(xì)
var X2={}    //my namespace:)
X2.Eval=function(code){
 if(!!(window.attachEvent && !window.opera)){
  
//ie
  execScript(code); 
 }else{
  
//not ie
  window.eval(code);
 }
}
        鐜板湪濡傛灉瑕佹兂鍦ㄥ嚱鏁板唴瀹氫箟鍏ㄥ眬浠g爜錛屽氨鍙互閫氳繃璋冪敤X2.Eval(code)鏂規(guī)硶錛屼竴涓緥瀛愬涓嬶細(xì)
var s='global';
function demo3(){
 X2.Eval('var s="local"');
}
demo3();
alert(s); //->'local'
        鍙錛屽湪demo3鍑芥暟鍐呴噸鏂板畾涔変簡鍏ㄥ眬鍙橀噺s="local"銆?br />         闇瑕佹敞鎰忕殑鏄疿2.Eval騫朵笉榪斿洖鍊鹼紝濡傛灉瑕佽繘琛岃〃杈懼紡鐨勬眰鍊鹼紝榪樻槸鐢ㄧ郴緇熺殑eval鍑芥暟銆俋2.Eval璁捐涓轟粎鍋氬叏灞浠g爜瀹氫箟鐢ㄣ?/div>
        鍏跺疄鐪嬪埌榪欓噷錛屾垨璁告湁浜烘劅瑙夐棶棰樹篃澶鏄撹В鍐充簡鐐癸紝鍛靛懙錛屼絾鍙戠幇榪欎釜鍔炴硶鍊掓槸闇瑕佷簺榪愭皵鍜屾妧宸х殑錛?br /> 錛?錛夊浜嶪E嫻忚鍣紝榛樿宸茬粡鎻愪緵浜嗚繖鏍風(fēng)殑鍑芥暟錛歟xecScript錛岀敤浜庡湪鍏ㄥ眬絀洪棿鎵ц浠g爜錛屽彧鏄煡閬撶殑浜鴻繕涓嶅銆?br /> 錛?錛夊浜嶧irefox嫻忚鍣紝鐩存帴璋冪敤eval鍑芥暟錛屽垯鍦ㄨ皟鐢ㄨ呯殑絀洪棿鎵ц錛涘鏋滆皟鐢?nbsp;      window.eval鍒欏湪鍏ㄥ眬絀洪棿鎵ц銆傝繖涓煡閬撶殑浜轟及璁″氨鏇村皯浜嗐傛瘯绔焌lert(eval==window.eval)榪斿洖true錛?/div>
         Firefox鐨別val鍑芥暟鐨勭壒鐐圭殑紜槸寰堜護(hù)浜哄鎬殑錛屼絾浠巎avascript瑙勮寖涓掍篃鑳芥壘鍒板叾鏉ユ簮錛?/div>
If value of the eval property is used in any way other than a direct call (that is, other than by the explicit use of its
name as an Identifier which is the MemberExpression in a CallExpression), or if the eval property is assigned to,
an EvalError exception may be thrown.
      鎰忔濆ぇ姒傚氨鏄eval鍑芥暟鐨勬墽琛屾槸鍜岃皟鐢ㄨ呯浉鍏崇殑錛屼絾騫舵病鏈夎鍏舵墽琛屼笂涓嬫枃鐨勯棶棰樸傛墍浠E鍜孎irefox瀛版槸瀛伴潪涔熷氨寰堥毦璇翠簡錛屽ぇ瀹剁煡閬撹В鍐沖姙娉曞氨濂姐?/div>
 
 


seal 2009-05-19 10:10 鍙戣〃璇勮
]]>
鍦╔HTML涓嬌鐢╦avascripthttp://www.tkk7.com/sealyu/archive/2009/05/13/270406.htmlsealsealWed, 13 May 2009 06:28:00 GMThttp://www.tkk7.com/sealyu/archive/2009/05/13/270406.htmlhttp://www.tkk7.com/sealyu/comments/270406.htmlhttp://www.tkk7.com/sealyu/archive/2009/05/13/270406.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/270406.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/270406.html

Making JavaScript Compatible with XHTML

XHTML is subject to the same syntactical rules as XML. Because of this, an XHTML processor treats the characters < and & as markup, even if they reside inside a <script> block. Since the < and & characters are also used by the JavaScript language, this creates a conflict. When an XHTML processor sees these characters within the JavaScript code of a <script> block, it attempts to parse the JavaScript code as if it were markup, which causes the XHTML parser to fail.

You can get around this conflict and make all JavaScript code compatible with XHTML by placing the JavaScript code within a CDATA section. A CDATA section in XML/XHTML starts with the characters <![CDATA[ and ends with the characters ]]>.

Any characters within the starting and ending element of a CDATA section are not treated by the XML/XHTML processor as markup, thus preventing a conflict.

Here is an example of how to declare JavaScript code within a CDATA section so that it is compatible with XHTML:

<script type="text/javascript">
//<![CDATA[

alert("<This is compatible with XHTML>");

//]]>
</script>

Note that JavaScript source code must be placed within the opening and closing elements of the CDATA section. The CDATA section itself should be commented out with a JavaScript single-line comment // as in the example above. This is so that the JavaScript interrupter does not interpret the CDATA markup as JavaScript, which would cause a JavaScript error.

JavaScript code that is imported into an XHTML document from an external source file is always compatible with XHTML. So, for example, any code you place into the external file external.js and import into an XHTML file via the src attribute of the <script> tag will be valid. Here is an example of how to import the file external.js:

<script type="text/javascript" src="external.js"></script>

鍦╔HTML鏂囨。涓悎閫傜殑浣跨敤CSS鍜孞avaScript

XHTML™ 1.0 The Extensible HyperText Markup Language (Second Edition) 瀹氫箟XHTML鏄負(fù)浜嗘妸HTML 4鎵╁睍鎴愬儚XML 1.0涓鏍風(fēng)殑搴旂敤紼嬪簭銆?

鍦ㄨ澶氱珯鐐逛腑XHTML姝e湪榪呴熺殑鏇夸唬HTML 4錛涚劧鑰岋紝涓繪祦嫻忚鍣ㄥ瀹屽叏鏀寔XHTML鏂歸潰琛ㄧ幇寰椾笉瓚籌紝鍜岀綉欏佃璁″笀瀵笻TML 4涓嶺HTML鐨勫熀鏈樊寮傜己涔忕悊瑙o紝浜х敓浜嗗綋浠婄綉緇滀笂鐨勪竴涓笉鏂墿澶х殑闂銆?

XHTML鏄疿ML,涓嶆槸HTML

鍏朵腑鍏充簬XHTML鐨勪富瑕佺殑璇В鏄紝瀹冧粎浠呮槸鍙﹀涓涓増鏈殑HTML銆傝繖涓瑙d駭鐢熶簬榪欐牱鐨勪簨瀹烇細(xì)Microsoft® Internet Explorer鍙湪鏂囦歡浠ime綾誨瀷涓?text/html鎻愪氦鏃訛紝鎵嶆敮鎸乆HTML錛岃屾爣鍑嗕腑寤鴻鐨勭被鍨嬪叾瀹炴槸application/xhtml+xml銆?

褰撲竴涓猉HTML欏甸潰鐨凪IME綾誨瀷琚彁浜や負(fù)text/html鏃訛紝瀹冭鎵鏈夌殑嫻忚鍣ㄥ綋浣淗TML澶勭悊錛屽氨濂藉儚XHTML姣旇搗HTML鏉ユ病鏈変換浣曚笉鍚屻備絾鏄綋涓涓猉HTML欏甸潰鐨凪IME綾誨瀷琚彁浜や負(fù)text/xml鎴?tt>application/xhtml+xml鏃訛紝瀹冨皢琚綋浣淴ML鏂囨。澶勭悊錛岃岃璁″拰鏄劇ずXML閮芥槸蹇呴』瑕侀伒瀹堜弗鏍艱鍒欑殑銆?

鐪熸鐨刋HTML灝辨槸涓涓猉ML鐨勫簲鐢紝鎵浠ュ垱寤篨HTML鏃朵篃瑕侀伒瀹堜弗鏍肩殑瑙勫垯銆傜壒鍒槸錛?

  1. 鏈粡榪囧鐞嗙殑<鍜?tt>&涓嶅厑璁稿嚭鐜板湪CDATA鍖哄煙錛?tt><!CDATA...>錛変箣澶栥?
  2. 娉ㄩ噴(<!鈥斺?... 鈥斺?gt;)涓笉鑳藉寘鍚弻妯嚎銆?
  3. 鍖呭惈鍦ㄦ敞閲?<!鈥斺?... 鈥斺?gt;)涓殑鍐呭灝嗚蹇界暐銆?

鍦ㄥ唴宓岀殑style鍜?tt>script涓嚭鐜扮殑闂

鍦ㄨ褰撲綔XML鑰屼笉鏄疕TML澶勭悊鏃訛紝鍐呭祵鐨剆tyle鍜宻cript鏍囪浼?xì)漶旂敓鍑犱釜涓嶅悓鐨勯棶棰樸?

JavaScript涓寘鍚簡涓浜涘湪XHTML涓笉鍏佽瀛樺湪鐨勫瓧絎?

鍏稿瀷鐨凧avaScript涓寘鍚簡涓浜涚壒孌婂瓧絎︼紝榪欎簺瀛楃鍦╔HTML涓槸涓嶅厑璁告斁鍦–DATA鍖哄煙涔嬪鐨勩?

<script type="text/javascript">

var i = 0;



while (++i < 10)

{

// ...

}

</script>

娉ㄦ剰榪欎釜渚嬪瓙涓嶆槸浠ユ紜牸寮忎功鍐欑殑XHTML錛屽洜涓轟嬌鐢ㄤ簡鏈粡澶勭悊鐨?#8220;<”錛屽畠鍙兘鍦ㄨ褰撲綔XHTML鎴朮ML鏍囪鐨勪竴閮ㄥ垎鏃跺嚭鐜般?

鍦ㄥ唴宓岀殑style鍜?tt>script涓嬌鐢ㄦ敞閲?

鐔熸?zhèn)塇TML鐨勮璁″笀閫氬父鎶婂唴宓岀殑style鍜?tt>script鍐呭鏀懼埌娉ㄩ噴涓紝榪欐牱鍙互鍦ㄤ笉鏀寔鏍峰紡鍜岃剼鏈殑嫻忚鍣ㄤ腑闅愯棌瀹冧滑銆?

<style type="text/css">

<!--

body {background-color: blue; color: yellow;}

-->

</style>

<script type="text/javascript">

<!--

var i = 0;

var sum = 0;



for (i = 0; i < 10; ++i)

{

sum += i;

}

alert('sum = ' + sum);

// -->

</script>

榪欎釜渚嬪瓙涓句緥璇存槑浜嗙壒瀹氱殑嫻忚鍣ㄥ彲浠ュ拷鐣ユ敞閲婇噷鐨勫唴瀹廣傚彟澶栵紝榪欎釜渚嬪瓙榪樻樉紺轟簡涓嶅悓鐨勬祻瑙堝櫒鍦ㄥ鐞?tt>text/xml鎴栬?application/xhtml+xml鍐呭鏃朵駭鐢熺殑涓嶅悓闂銆?

Mozilla 1.1+/Opera 7
涓嶈兘浣跨敤CSS錛屼篃涓嶈兘鎵цJavaScript銆?
Netscape 7.0x/Mozilla 1.0.x
涓嶈兘浣跨敤CSS錛屼絾鍙互鎵цJavaScript銆?
Internet Explorer 5.5+
鏃犳硶姝e父鏄劇ず鏂囨。銆?

鍖呭惈鍙屾í綰跨殑鍐呭祵style鍜?tt>script

鍙︿竴涓妸JavaScript鍖呭惈鍦╔HTML鏂囦歡鐨勬敞閲婁腑浜х敓鐨?a rel="internal" >闂錛屼笌鍦╔HTML鐨勬敞閲婁腑浣跨敤鍙屾í綰夸細(xì)浜х敓鐨勯棶棰樹竴鏍楓?

<script type="text/javascript">

<!--

var i;

var sum = 0;



for (i = 10; i > 0; --i)

{

sum += i;

}

// -->

</script>

浣跨敤CDATA鏇夸唬娉ㄩ噴

鐩存帴鎶奐avaScript鏀懼叆CDATA鍖哄煙浼?xì)鍦ㄤ綆鐗堟湰涓嶆敮鎸乆ML鐨勬祻瑙堝櫒涓駭鐢熼棶棰橈紝涓嶈繃錛屾妸JavaScript鐨勬敞閲?//……)涓嶤DATA涓璧蜂嬌鐢紝灝辮兘瑙e喅鍚戜笅鍏煎鐨勯棶棰樹簡銆?

<script type="text/javascript">

//<![CDATA[

var i = 0;



while (++i < 10)

{

// ...

}

//]]>

</script>

渚嬪瓙

鍦ㄦ敞閲婁腑浣跨敤鍐呭祵style鐨凜SS瑙勫垯

渚嬪瓙1 - XHTML 1.0 Strict鍦?tt>text/html
榪欎釜渚嬪瓙涓句緥璇存槑褰揅SS瑙勫垯鍖呭惈鍐呰仈鍜屽寘鍚湪娉ㄩ噴涓椂鐨刋HTML鍦?tt>text/html鐨勮涓恒傝繖涓緥瀛愭敮鎸丯etscape 7.x錛孧ozilla錛孫pera 7鍜孖nternet Explorer 5.5+閭d竴涓兘鑳藉儚鏈熸湜涓鏍峰簲鐢–SS瑙勫垯銆?
渚嬪瓙2 - XHTML 1.0 Strict鍦?tt>text/xml
榪欎釜渚嬪瓙涓句緥璇存槑褰揅SS瑙勫垯鍖呭惈鍐呰仈鍜屽寘鍚湪娉ㄩ噴涓椂鐨刋HTML鍦?tt>text/xml鐨勮涓恒傝繖涓緥瀛愭敮鎸丯etscape 7.x錛孧ozilla錛孫pera 7浣?strong>涓嶆敮鎸両nternet Explorer 5.5+銆傛敞鎰廵tscape 7.x錛孧ozilla鍜孫pera鍚屾剰鍖呭惈鍦ㄦ敞閲婄殑鍐呰仈CSS瑙勫垯灝嗚蹇界暐銆?
渚嬪瓙3 - XHTML 1.0 Strict鍦?tt>application/xhtml+xml
榪欎釜渚嬪瓙涓句緥璇存槑褰揅SS瑙勫垯鍖呭惈鍐呰仈鍜屽寘鍚湪娉ㄩ噴涓椂鐨刋HTML鍦?tt>application/xhtml+xml鐨勮涓恒傝繖涓緥瀛愭敮鎸丯etscape 7.x錛孧ozilla錛孫pera 7浣?strong>涓嶆敮鎸両nternet Explorer 5.5+銆傛敞鎰廵tscape 7.x錛孧ozilla鍜孫pera鍚屾剰鍖呭惈鍦ㄦ敞閲婄殑鍐呰仈CSS瑙勫垯灝嗚蹇界暐銆?

浣跨敤澶栭儴鏂囦歡鐨凜SS瑙勫垯

渚嬪瓙4 - XHTML 1.0 Strict鍦?tt>text/html
榪欎釜渚嬪瓙涓句緥璇存槑褰撳湪浣跨敤澶栭儴鏂囦歡鐨凜SS瑙勫垯鐨勬椂鍊橷HTML鍦?tt>text/html鐨勮涓恒傝繖涓緥瀛愭敮鎸丯etscape 7.x錛孧ozilla錛孫pera 7鍜孖nternet Explorer 5.5+銆?
渚嬪瓙5 - XHTML 1.0 Strict鍦?tt>text/xml
榪欎釜渚嬪瓙涓句緥璇存槑褰撳湪浣跨敤澶栭儴鏂囦歡鐨凜SS瑙勫垯鐨勬椂鍊橷HTML鍦?tt>text/xml鐨勮涓恒傝繖涓緥瀛愭敮鎸丯etscape 7.x錛孧ozilla鍜孫pera 7浣嗕笉鏀寔涓嶆敮鎸両nternet Explorer 5.5+銆?
渚嬪瓙6 - XHTML 1.0 Strict鍦?tt>application/xhtml+xml
榪欎釜渚嬪瓙涓句緥璇存槑褰撳湪浣跨敤澶栭儴鏂囦歡鐨凜SS瑙勫垯鐨勬椂鍊橷HTML鍦?tt>application/xhtml+xml鐨勮涓恒傝繖涓緥瀛愭敮鎸丯etscape 7.x錛孧ozilla鍜孫pera 7浣嗕笉鏀寔涓嶆敮鎸両nternet Explorer 5.5+銆?

寤鴻

涓嶈鍦╔HTML涓唴鑱?tt>style鎴?tt>script

鐢ㄥ閮ㄦ枃浠跺寘鍚獵SS瑙勫垯鍜孞avaScript鏉ユ浛鎹㈠唴鑱旀牱寮忓拰鑴氭湰鏄垱寤篨HTML鏈浣蟲柟寮忥紝鍦ㄥ悜鍚庡吋瀹規(guī)柟寮忔椂錛屽鏋滃唴瀹圭殑MIME綾誨瀷浠?tt>text/html鍚?tt>application/xhtml+xml鏀瑰彉鏃跺皢涓嶄細(xì)琚墦鏂?

榪欎釜寤鴻鍙兘鐪嬭搗鏉ユ洿寮虹儓錛屽彲鏄紝瀹冩槸鏈潵XHTML瑕佹墦綆楃殑闂錛屽綋XHTML鍦?tt>text/html鍚?tt>application/xhtml+xml杞Щ鍦ㄥ嚑騫村悗鍙戠敓銆?

濡傛灉浣犱粎浠呮祴璇曚綘鐨刋HTML鍦?tt>text/html鐨勬椂鍊欙紝閭d箞浣犲彲鑳戒駭鐢熼棶棰橈紝渚嬪鍍忥細(xì)涓嶈兘鍑嗙‘鐨勬弿榪板嚭涓婚銆傜Щ鍔–SS鍜孞avaScript鍒板崟鐙殑鏂囦歡鏄彲闈犵殑鏂規(guī)硶錛屽叧浜庢敼鍙樹綘XHTML鐨勬湇鍔℃柟寮忋?

鐞嗚ВXHTML 1.0鐨凥TML鍏煎鎸囧

榪欎釜XHTML 1.0 HTML Compatibility Guidelines甯姪鍒涘緩XHTML鏂囨。鍚戝悗鍏煎鎬у湪閭d簺涓嶈兘鐞嗚ВXML鐨勮佹祻瑙堝櫒銆?

璇鋒敞鎰忛偅鏄函綺圭殑XHTML鏂囨。錛屼綘涓嶉渶瑕佷嬌鐢▁ml-stylesheet澶勭悊鎸囧錛屼絾搴旇浣跨敤link娑夊強(qiáng)鐨勫閮ㄦ枃浠跺寘鍚獵SS銆?



鍙﹀錛岄檮XHTML鐨勪竴浜涜鑼冿細(xì)
1.鎵鏈夌殑鏍囪閮藉繀欏昏鏈変竴涓浉搴旂殑緇撴潫鏍囪
浠ュ墠鍦?nbsp;HTML 涓?浣犲彲浠ユ墦寮璁稿鏍囩,渚? 濡?nbsp;<p> 鍜?nbsp;<li> 鑰屼笉涓瀹氬啓瀵瑰簲鐨?nbsp;</p> 鍜?nbsp;</li> 鏉ュ叧闂畠浠?浣? 鍦?nbsp;XHTML 涓繖鏄笉鍚堟硶鐨?XHTML瑕佹眰鏈変弗璋ㄧ殑緇撴瀯,鎵鏈夋爣絳懼繀欏誨叧闂?濡傛灉鏄崟鐙笉鎴愬鐨勬爣絳?鍦ㄦ爣絳炬渶鍚庡姞涓涓?nbsp;"/" 鏉ュ叧闂畠.渚嬪:
<br /><img height="80" alt="緗戦〉璁捐甯? src="http://images/logo_w3cn_200x80.gif"&n ... 00" /> 

2.鎵鏈夋爣絳劇殑鍏冪礌鍜屽睘鎬х殑鍚嶅瓧閮藉繀欏諱嬌鐢ㄥ皬鍐?br /> 涓?nbsp;HTML 涓? 涓鏍?XHTML 瀵瑰ぇ灝忓啓鏄晱鎰熺殑,<title> 鍜?nbsp;<TITLE> 鏄笉鍚岀殑鏍囩.XHTML 瑕佹眰鎵鏈夌殑鏍囩鍜屽睘鎬х殑 鍚嶅瓧閮藉繀欏諱嬌鐢ㄥ皬鍐?渚嬪:<BODY> 蹇呴』鍐欐垚 <body> .澶у皬鍐欏す鏉備篃鏄笉琚鍙殑,閫? 甯?nbsp;dreamweaver 鑷姩鐢熸垚鐨勫睘鎬у悕瀛?nbsp;"onMouseOver" 涔熷繀欏諱慨鏀規(guī)垚 "onmouseover".

3.鎵鏈夌殑 XML 鏍囪閮藉繀欏誨悎鐞嗗祵濂?br /> 鍚屾牱鍥犱負(fù) XHTML 瑕佹眰鏈変弗璋ㄧ殑緇撴瀯,鍥犳鎵鏈夌殑宓屽閮藉繀欏繪寜欏哄簭,浠ュ墠鎴戜滑榪欐牱鍐欑殑浠g爜:
<p><b></p></b> 
蹇呴』淇敼涓?
<p><b></b></p> 
灝辨槸璇?涓灞備竴灞傜殑宓屽蹇呴』鏄弗鏍煎縐?

4.鎵鏈夌殑灞炴у繀欏葷敤寮曞彿 "" 鎷搗鏉?br /> 鍦?nbsp;HTML 涓?浣犲彲浠ヤ笉闇瑕佺粰灞炴у煎姞寮曞彿,浣嗘槸鍦?nbsp;XHTML 涓?瀹冧滑蹇呴』琚姞寮曞彿.渚嬪:
<height=80> 
蹇呴』淇敼涓?
<height="80"> 
鐗規(guī)畩鎯呭喌,浣犻渶瑕佸湪灞炴у奸噷浣跨敤鍙屽紩鍙?浣犲彲浠ョ敤 ",鍗曞紩鍙峰彲浠ヤ嬌鐢?nbsp;&apos;,渚嬪:
<alt="say&apos;hello&apos;"> 


5.鎶婃墍鏈?nbsp;< 鍜?nbsp;& 鐗規(guī)畩絎﹀彿鐢ㄧ紪鐮佽〃紺?br /> 浠諱綍灝忎簬鍙鳳紙<錛?涓嶆槸鏍囩鐨勪竴閮ㄥ垎,閮藉繀欏昏緙栫爜涓?nbsp;&lt;
浠諱綍澶т簬鍙鳳紙>錛?涓嶆槸鏍囩鐨勪竴閮ㄥ垎,閮藉繀欏昏緙栫爜涓?nbsp;&gt;
浠諱綍涓庡彿錛?amp;錛?涓嶆槸瀹炰綋鐨勪竴閮ㄥ垎鐨?閮藉繀欏昏緙栫爜涓?nbsp;&amp;

6.緇欐墍鏈夊睘鎬ц祴涓涓?br /> XHTML 瑙勫畾鎵鏈夊睘鎬ч兘蹇呴』鏈変竴涓?娌℃湁鍊肩殑灝遍噸澶嶆湰韜?渚嬪:
<td nowrap> <input type="checkbox" name="shirt" value="medium" checked> 
蹇呴』淇敼涓?
<td nowrap="nowrap"> <input type="checkbox" name="shirt" value="medium" checked="checked" /> 

7.涓嶈鍦ㄦ敞閲婂唴瀹逛腑浣跨敤 "--","--" 鍙兘鍙戠敓鍦?nbsp;XHTML 娉ㄩ噴鐨勫紑澶村拰緇撴潫,涔熷氨鏄,鍦ㄥ唴瀹逛腑瀹冧滑涓嶅啀鏈夋晥.渚嬪涓嬮潰鐨勪唬鐮佹槸鏃犳晥鐨?
<!--榪欓噷鏄敞閲?----------榪欓噷鏄敞閲?-> 
鐢ㄧ瓑鍙鋒垨鑰呯┖鏍兼浛鎹㈠唴閮ㄧ殑铏氱嚎:
<!--榪欓噷鏄敞閲?===========榪欓噷鏄敞閲?-> 

浠ヤ笂榪欎簺瑙勮寖鏈夌殑鐪嬩笂鍘繪瘮杈冨鎬?浣嗚繖涓鍒囬兘鏄負(fù)浜嗕嬌鎴戜滑鐨勪唬鐮佹湁涓涓粺涓銆佸敮涓鐨勬爣鍑?渚夸簬浠ュ悗鐨勬暟鎹啀鍒╃敤.



seal 2009-05-13 14:28 鍙戣〃璇勮
]]>javascript 鍒ゆ柇鏌愰〉闈笂鐨勮〃鍗曟暟鎹槸鍚︽敼鍙樿繃 (杞?http://www.tkk7.com/sealyu/archive/2009/05/13/270347.htmlsealsealWed, 13 May 2009 02:02:00 GMThttp://www.tkk7.com/sealyu/archive/2009/05/13/270347.htmlhttp://www.tkk7.com/sealyu/comments/270347.htmlhttp://www.tkk7.com/sealyu/archive/2009/05/13/270347.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/270347.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/270347.html

鏈枃杞嚜錛?/span>http://info.codepub.com/2008/09/info-22582.html

鍘熸枃濡備笅錛?/span>

浣跨敤鍦哄悎錛氬綋鏌愪釜欏甸潰鏁版嵁淇敼鏃訛紝闇瑕佹墽琛屾煇浜涙搷浣滄椂   
鍦ㄩ〉闈㈢殑body鍔犺澆浜嬩歡錛坥nload錛変腑鍔犱笂initFileds()灝卞彲浠ヨ褰曢〉闈㈢殑鍒濆鏁版嵁
鍦ㄩ渶瑕佸垽鏂〉闈㈡暟鎹槸鍚︽敼鍙樻椂璋冪敤checkModification()鏂規(guī)硶灝卞彲鍒ゆ柇鏁版嵁鏄惁鏀瑰彉
榪斿洖鍊間負(fù)true灝辨槸宸茬粡鏀瑰彉
榪斿洖鍊間負(fù)false灝辨槸娌℃湁鏀瑰彉
   
    // 欏甸潰緙栬緫鏁版嵁
    var inputsData;
    var textareasData;
    var selectsData;
    // 璁板綍涓嬭〃鍗曚腑鐨勫師濮嬪?br />     function initFileds() {
        var inputs = document.getElementsByTagName("input");
        var textareas = document.getElementsByTagName("textarea");
        var selects = document.getElementsByTagName("select");
        inputsData = new Array(inputs.length);
        for (var i=0;i<inputs.length;i++) {
            inputsData[i] = inputs[i].value;
            if (inputs[i].type=="radio") {
                inputsData[i]=inputs[i].checked;
            }
        }
        textareasData = new Array(textareas.length);
        for (var i=0;i<textareas.length;i++) {
            textareasData[i] = textareas[i].value;
        }
        selectsData = new Array(selects.length);
        for (var i=0;i<selects.length;i++) {
            selectsData[i] = selects[i].value;
        }
    }
    /*
     * 鍒ゆ柇琛ㄥ崟涓兼槸鍚﹁淇敼浜?br />      * submitCommand 琛ㄥ崟鏈夋敼鍔ㄦ椂,鎵ц鐨刯avascript浠g爜
     */
    function checkModification(submitCommand) {
        var inputs = document.getElementsByTagName("input");
        var textareas = document.getElementsByTagName("textarea");
        var selects = document.getElementsByTagName("select");
        var hasBeenChanged = false;
        for (var i=0;i<inputs.length;i++) {
            if (inputs[i].type=="radio"&&(inputs[i].checked!=inputsData[i])) {
                hasBeenChanged = true;
                inputsData[i]=inputs[i].checked;
            }
            if (inputs[i].type!="radio"&&inputsData[i]!=inputs[i].value) {
             if(inputs[i].name!="actionType"){
                 hasBeenChanged = true;
                }
                inputsData[i]=inputs[i].value;
            }
        }
        for (var i=0;i<textareas.length;i++) {
            if (textareasData[i]!=textareas[i].value) {
                hasBeenChanged = true;
                textareasData[i]=textareas[i].value;
            }
        }
        for (var i=0;i<selects.length;i++) {
            if (selectsData[i]!=selects[i].value) {
                hasBeenChanged = true;
                selectsData[i]=selects[i].value;
            }
        }
         if (hasBeenChanged&&confirm("鏁版嵁宸茬粡鏀瑰彉,鏄惁淇濆瓨錛?)) {
             eval(submitCommand);
         }
    }


seal 2009-05-13 10:02 鍙戣〃璇勮
]]>
10涓熀浜?JavaScript 鐨?WYSIWYG 緙栬緫鍣?杞?http://www.tkk7.com/sealyu/archive/2009/04/27/267680.htmlsealsealMon, 27 Apr 2009 02:23:00 GMThttp://www.tkk7.com/sealyu/archive/2009/04/27/267680.htmlhttp://www.tkk7.com/sealyu/comments/267680.htmlhttp://www.tkk7.com/sealyu/archive/2009/04/27/267680.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/267680.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/267680.htmlCOMSHARP CMS 鍐欓亾錛氬湪綰跨紪杈戝唴瀹圭殑鏃跺欙紝閭d簺鍩轟簬 JavaScript 鐨勭紪杈戝櫒甯簡鎴戜滑澶у繖錛岃繖浜涙墍瑙佸嵆鎵寰楋紙WYSIWYG錛夌紪杈戝櫒錛岀粰鎴戜滑鎻愪緵浜嗙被浼? Office 鐨勬搷浣滀綋楠屻傚浠婏紝浠諱綍緗戠珯鍐呭綆$悊緋葷粺錛圕MS錛夊拰鍗氬緋葷粺閮介渶瑕佷竴涓繖鏍風(fēng)殑緙栬緫鍣ㄣ傛湰鏂囩簿閫変簡10涓熀浜?JavaScript  鐨勭紪杈戝櫒錛屽畠浠湁鐨勬槸鍩轟簬 jQuery 妗嗘灦錛屾湁鐐瑰垯涓嶆槸銆?/p>

MarkitUp - jQuery

Official Website | Demo
MarkitUp

鍔熻兘涓嶆槸寰堝錛屼絾寰堣交閲忥紝寰堢伒媧匯傛墦鍖呭悗鍙湁6.5K澶у皬銆?/p>

jWYSIWYG - jQuery

Official Website | Demo
jWYSIWYG

闈炲父鍩烘湰鐨勭紪杈戝櫒錛岀畝鍗曚負(fù)鏈傛墦鍖呭悗鍙湁7K銆?/p>

Lightweight RTE- jQuery

Official Website | Demo
jWYSIWYG

綆鍗曞埌涓嶈兘鍐嶇畝鍗曪紝寰堝鏄撹嚜宸變慨鏀廣?/p>

HTMLBox - jQuery

Official Website | Demo
HTMLBox

璺ㄦ祻瑙堝櫒錛屽紑婧愶紝鍩轟簬 jQuery銆傚彲浠ュ緢瀹規(guī)槗鍚屽悇縐?CMS錛岃鍧涳紝鐣欒█鏈紝鍗氬絳夌郴緇熼泦鎴愩?/p>

D Small Rich Text Editor - jQuery

Official Website | Demo
D Small Rich Text Editor

鍩轟簬 iframe 瀵硅薄銆?/p>

WYMEditor - jQuery

Official Website | Demo
WYMEditor

<!-- ################## NON jQUery ################### -->

TinyMCE - non-jQuery

Official Website | Demo
TinyMCE

鏈緇忓吀鐨勫熀浜?JavaScript 鐨勭紪杈戝櫒錛孋OMSHARP CMS 榛樿鐨勭紪杈戝櫒灝辨槸榪欎釜銆?/p>

fckeditor - Non-jQuery

Official Website | Demo
fckeditor

鍔熻兘闈炲父寮哄ぇ銆?/p>

Yahoo YUI Rich Text Editor - Non-jQuery

Official Website | Demo
Yahoo UI RTE

鍩轟簬 Yahoo YUI錛岀畝鍗曪紝浣嗗緢鍙潬銆?/p>

Xinha - Non-jQuery

Official Website | Demo
Xinha

鑷敱鐨勫熀浜?nbsp; BSD 璁稿彲緙栬緫鍣紝鍔熻兘瀹屽杽錛屽緢閫傚悎鍚屽悇縐嶇郴緇熼泦鎴愩?/p>

鏈枃鍘熸枃鏉ユ簮錛?a >http://www.queness.com/post/212/10-jquery-and-non-jquery-javascript-rich-text-editors



seal 2009-04-27 10:23 鍙戣〃璇勮
]]>
javascript鍒ゆ柇鍙橀噺鏄惁瀹氫箟http://www.tkk7.com/sealyu/archive/2009/03/17/260193.htmlsealsealTue, 17 Mar 2009 02:49:00 GMThttp://www.tkk7.com/sealyu/archive/2009/03/17/260193.htmlhttp://www.tkk7.com/sealyu/comments/260193.htmlhttp://www.tkk7.com/sealyu/archive/2009/03/17/260193.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/260193.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/260193.html 渚嬪錛?br /> if(hasLoaded){
  //Do something here
}
濡傛灉姝ゅ彉閲忚繕鏈瀹氫箟錛屽氨浼?xì)鎶ラ敊锛?xì) 'xxxx' is #790000.

榪欐椂錛屽氨闇瑕佸榪欎釜鍙橀噺榪涜鍒ゆ柇錛?br /> if(typeof(hasLoaded) != 'undefined'){
  if(hasLoaded){
    //Do something here
  }
}




seal 2009-03-17 10:49 鍙戣〃璇勮
]]>
鐢?Javascript 鑾峰彇鎸囧畾欏甸潰鍏冪礌鐨勪綅緗?/title><link>http://www.tkk7.com/sealyu/archive/2009/02/23/256188.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Mon, 23 Feb 2009 03:34:00 GMT</pubDate><guid>http://www.tkk7.com/sealyu/archive/2009/02/23/256188.html</guid><wfw:comment>http://www.tkk7.com/sealyu/comments/256188.html</wfw:comment><comments>http://www.tkk7.com/sealyu/archive/2009/02/23/256188.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/sealyu/comments/commentRss/256188.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/sealyu/services/trackbacks/256188.html</trackback:ping><description><![CDATA[鐢?nbsp;Javascript 鑾峰彇鎸囧畾欏甸潰鍏冪礌鐨勪綅緗槸涓涓潪甯稿父瑙佺殑闇姹傦紝鏈枃浠嬬粛鐨勬柟娉曡兘澶熷噯紜繑鍥炰竴涓厓绱犵浉瀵逛簬鏁翠釜鏂囨。宸︿笂瑙掔殑鍧愭爣錛屽嵆鍏冪礌鐨?nbsp;top 銆乴eft 鐨勪綅緗紝鑰屼笖鑳藉鍏煎嫻忚鍣紝鐩鎬俊瀵規(guī)柊鎵嬮潪甯告湁鐢ㄣ?br /> <br /> <div> <div> <div><a onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;">view plain</a><a onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;">copy to clipboard</a><a onclick="dp.sh.Toolbar.Command('PrintSource',this);return false;">print</a><a onclick="dp.sh.Toolbar.Command('About',this);return false;">?</a></div> </div> <ol start="1"> <li><script language="javascript" type="text/javascript">  </li> <li>  </li> <li><!--    </li> <li>  </li> <li>// 璇存槑錛氱敤 Javascript 鑾峰彇鎸囧畾欏甸潰鍏冪礌鐨勪綅緗?nbsp;  </li> <li>  </li> <li>// 鏁寸悊錛歨ttp://www.codebit.cn   </li> <li>  </li> <li>// 鏉ユ簮錛歒UI DOM    </li> <li>  </li> <li>function getElementPos(elementId) {  </li> <li>  </li> <li>    var ua = navigator.userAgent.toLowerCase();       </li> <li>  </li> <li>    var isOpera = (ua.indexOf('opera') != -1);       </li> <li>  </li> <li>    var isIE = (ua.indexOf('msie') != -1 && !isOpera); // not opera spoof        </li> <li>  </li> <li>    var el = document.getElementById(elementId);   </li> <li>  </li> <li>          </li> <li>  </li> <li>    if(el.parentNode === null || el.style.display == 'none'){ return false; }        </li> <li>  </li> <li>    var parent = null;  </li> <li>  </li> <li>    var pos = [];     //涓嶅畾闀挎暟緇勶紵  </li> <li>  </li> <li>    var box;        </li> <li>  </li> <li>    if(el.getBoundingClientRect){  //IE       </li> <li>  </li> <li>        box = el.getBoundingClientRect();          </li> <li>  </li> <li>        var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop);          </li> <li>  </li> <li>        var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);            </li> <li>  </li> <li>        return {x:box.left + scrollLeft, y:box.top + scrollTop};       </li> <li>  </li> <li>    }else if(document.getBoxObjectFor){   // gecko                  </li> <li>  </li> <li>        box = document.getBoxObjectFor(el);                       </li> <li>  </li> <li>        var borderLeft = (el.style.borderLeftWidth)?parseInt(el.style.borderLeftWidth):0;           </li> <li>  </li> <li>        var borderTop = (el.style.borderTopWidth)?parseInt(el.style.borderTopWidth):0;            </li> <li>  </li> <li>        pos = [box.x - borderLeft, box.y - borderTop];       </li> <li>  </li> <li>    }else{    // safari & opera       </li> <li>  </li> <li>        pos = [el.offsetLeft, el.offsetTop];          </li> <li>  </li> <li>        parent = el.offsetParent;           </li> <li>  </li> <li>        if (parent != el) {  </li> <li>  </li> <li>            while (parent) {                   </li> <li>  </li> <li>                pos[0] += parent.offsetLeft;                 </li> <li>  </li> <li>                pos[1] += parent.offsetTop;               </li> <li>  </li> <li>                parent = parent.offsetParent;              </li> <li>  </li> <li>            }  </li> <li>  </li> <li>        }           </li> <li>  </li> <li>        if (ua.indexOf('opera') != -1  || ( ua.indexOf('safari') != -1 && el.style.position == 'absolute' )){                </li> <li>  </li> <li>            pos[0] -= document.body.offsetLeft;               </li> <li>  </li> <li>            pos[1] -= document.body.offsetTop;           </li> <li>  </li> <li>        }        </li> <li>  </li> <li>    }              </li> <li>  </li> <li>    if (el.parentNode) {   </li> <li>  </li> <li>        parent = el.parentNode;   </li> <li>  </li> <li>    } else {   </li> <li>  </li> <li>        parent = null;   </li> <li>  </li> <li>    }         </li> <li>  </li> <li>    while (parent && parent.tagName != 'BODY' && parent.tagName != 'HTML') { // account for any scrolled ancestors          </li> <li>  </li> <li>        pos[0] -= parent.scrollLeft;           </li> <li>  </li> <li>        pos[1] -= parent.scrollTop;        </li> <li>  </li> <li>        if (parent.parentNode) {   </li> <li>  </li> <li>            parent = parent.parentNode;   </li> <li>  </li> <li>        } else {   </li> <li>  </li> <li>            parent = null;   </li> <li>  </li> <li>        }       </li> <li>  </li> <li>    }       </li> <li>  </li> <li>    return {x:pos[0], y:pos[1]};  </li> <li>  </li> <li>}  //-->   </li> <li>  </li> <li></script>  <br /> </li> </ol> </div> <br /> <br /> 絎簩縐嶆柟娉曪細(xì)<br /> function WebForm_GetElementPosition(element) {<br />     var result = new Object();<br />     result.x = 0;<br />     result.y = 0;<br />     result.width = 0;<br />     result.height = 0;<br />     if (element.offsetParent) {<br />         result.x = element.offsetLeft;<br />         result.y = element.offsetTop;<br />         var parent = element.offsetParent;<br />         while (parent) {<br />             result.x += parent.offsetLeft;<br />             result.y += parent.offsetTop;<br />             var parentTagName = parent.tagName.toLowerCase();<br />             if (parentTagName != "table" &&<br />                 parentTagName != "body" && <br />                 parentTagName != "html" && <br />                 parentTagName != "div" && <br />                 parent.clientTop && <br />                 parent.clientLeft) {<br />                 result.x += parent.clientLeft;<br />                 result.y += parent.clientTop;<br />             }<br />             parent = parent.offsetParent;<br />         }<br />     }<br />     else if (element.left && element.top) {<br />         result.x = element.left;<br />         result.y = element.top;<br />     }<br />     else {<br />         if (element.x) {<br />             result.x = element.x;<br />         }<br />         if (element.y) {<br />             result.y = element.y;<br />         }<br />     }<br />     if (element.offsetWidth && element.offsetHeight) {<br />         result.width = element.offsetWidth;<br />         result.height = element.offsetHeight;<br />     }<br />     else if (element.style && element.style.pixelWidth && element.style.pixelHeight) {<br />         result.width = element.style.pixelWidth;<br />         result.height = element.style.pixelHeight;<br />     }<br />     return result;<br /> } <br /> <img src ="http://www.tkk7.com/sealyu/aggbug/256188.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/sealyu/" target="_blank">seal</a> 2009-02-23 11:34 <a href="http://www.tkk7.com/sealyu/archive/2009/02/23/256188.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>IE灞忚斀window.open()紿楀彛鐨勮В鍐沖姙娉?/title><link>http://www.tkk7.com/sealyu/archive/2008/11/08/239429.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Sat, 08 Nov 2008 09:16:00 GMT</pubDate><guid>http://www.tkk7.com/sealyu/archive/2008/11/08/239429.html</guid><wfw:comment>http://www.tkk7.com/sealyu/comments/239429.html</wfw:comment><comments>http://www.tkk7.com/sealyu/archive/2008/11/08/239429.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.tkk7.com/sealyu/comments/commentRss/239429.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/sealyu/services/trackbacks/239429.html</trackback:ping><description><![CDATA[浣滆咃細(xì) sealyu   鏃ユ湡錛?008-11-8<br /> <br /> 浠婂ぉ鍦ㄥ紑鍙戠殑鏃跺欙紝紕板埌瀹㈡埛鎻愬埌鐨勪竴涓棶棰橈紝<br /> 姣忔鍦ㄤ笅杞芥枃浠剁殑鏃跺欙紝IE閮戒細(xì)闃繪鎵撳紑鐨勪繚瀛樻枃浠剁殑瀵硅瘽妗嗐?br /> 鐪嬩簡涓涓嬩唬鐮侊紝鍙戠幇欏圭洰浣跨敤浜嗕竴涓猻tream servlet鏉ュ鐞嗘枃浠朵笅杞斤紝鍦ㄤ嬌鐢╝jax榪斿洖欏甸潰鍚庯紝浣跨敤window.open(link);鎵撳紑淇濆瓨瀵硅瘽妗嗐?br /> 闂搴旇灝卞鍦ㄨ繖閲屼簡錛孏oogle浜嗕竴涓嬶紝鍙戠幇榪欐槸鐢變簬IE鐨勫畨鍏ㄦ満鍒躲?br /> 鍦ㄥ井杞殑緗戠珯涓婃湁榪欎箞涓孌佃瘽錛?br /> <h1 class="title">Pop-Up Blocking</h1> <div id="1111116" class="intro"> <p>The Pop-up Blocking feature blocks pop-up (and pop-under) windows initiated automatically by a Web site. Internet Explorer blocks Pop-up windows in the <a target="_blank" logredir="CTT=ToExternal">Internet and Restricted sites zones</a> <script language="Javascript"> if(typeof(IsPrinterFriendly) != "undefined") { var l = "http://go.microsoft.com/fwlink/?linkid=26003"; var nl; var c = l.charAt(0); var o = document.getElementById("EKE"); switch (c){ case "/": nl=(" [http://" + document.domain + l + "]"); break case "#": nl=(""); break default: nl=" [" + l + "]" } if(o != null) o.innerHTML = nl; } </script> by default. However, the Pop-up Blocker enables pop-up windows initiated by a user action. Users can configure Internet Explorer 6 for Windows XP with SP2 to be more or less restrictive. Users can also turn off the Pop-up Blocker altogether. Generally, the Pop-up Blocker enables a window to open under the following circumstances:</p> <table border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td class="listBullet" valign="top">•</td> <td class="listItem"> <p>When initiated by user action, such as clicking a button or hyperlink</p> </td> </tr> <tr> <td class="listBullet" valign="top">•</td> <td class="listItem"> <p>When opened in the <a target="_blank" logredir="CTT=ToExternal">Trusted sites and Local intranet zones</a> <script language="Javascript"> if(typeof(IsPrinterFriendly) != "undefined") { var l = "http://go.microsoft.com/fwlink/?linkid=26003"; var nl; var c = l.charAt(0); var o = document.getElementById("EWE"); switch (c){ case "/": nl=(" [http://" + document.domain + l + "]"); break case "#": nl=(""); break default: nl=" [" + l + "]" } if(o != null) o.innerHTML = nl; } </script> (considered safe)</p> </td> </tr> <tr> <td class="listBullet" valign="top">•</td> <td class="listItem"> <p>When opened by other applications running on the local computer</p> </td> </tr> </tbody> </table> <p>The affected script methods are:</p> <pre class="codeSample">window.open<br /> window.showHelp<br /> window.showModalDialog<br /> window.showModelessDialog<br /> window.external<br /> window.NavigateAndFind</pre> <table class="sidebarContent" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr style="padding: 0px 0px 7px;" onclick=""> <td class="dropCapQ" style="vertical-align: top;" align="left" nowrap="nowrap"><br /> </td> <td style="vertical-align: top;"> <h5><img src="http://technet2.microsoft.com/library/gallery/templates/MNP2.Common/images/note.gif" alt="" border="0" height="10" width="10" />娉細(xì)</h5> </td> </tr> <tr class="" id="eCE6E" style="padding: 0px 0px 7px;" valign="top"> <td class="dropCapQ" align="right" nowrap="nowrap"><br /> </td> <td> <p>Pop-ups created with <font face="Courier New"><strong>window.createPopup</strong></font> are unaffected by the Pop-up Blocker.</p> </td> </tr> </tbody> </table> </div> <p style="text-indent: 2em;">鍦╳eb緙栫▼榪囩▼涓紝緇忓父浼?xì)閬囧堫C竴浜涢〉闈㈤渶瑕佸脊鍑虹獥鍙o紝浣嗘槸鍦ㄦ湇鍔″櫒绔敤window.open寮瑰嚭鐨勭獥鍙d細(xì)琚獻(xiàn)E闃繪鎺夛紝<a><font color="#43699a">showModalDialog</font></a>寮瑰嚭鐨勭獥鍙f湁鏃跺茍涓嶈兘婊¤凍鎴戜滑闇瑕侊紝鎴戜滑闇瑕佸脊鍑烘柊鐨勬祻瑙堝櫒紿楀彛銆?/p> <p style="text-indent: 2em;"> 涓轟粈涔堟垜浠紪鍐欑殑寮瑰嚭紿楀彛浼?xì)琚獻(xiàn)E闃繪鍛紝鍘熸潵IE浼?xì)鑷姩鍒ゆ柇寮瑰嚭绐楀彛鐨勭姸鎬侊紝瀹冧細(xì)闃繪鑷姩寮瑰嚭鐨勭獥鍙o紝鑰岄氳繃鎴戜滑鐢ㄩ紶鏍囩偣鍑誨脊鍑虹殑紿楀彛錛屽畠鏄笉浼?xì)闃绘鐨勩傝繖閲屽氨鏈変竴涓棶棰橈紝鏈変漢璇達(dá)細(xì)鎴戠殑紼嬪簭鏄啓鍦ㄦ湇鍔″櫒鎸夐挳閲岀殑錛屼篃鏄氳繃榧犳爣鐐瑰嚮寮瑰嚭鐨勫憖錛佸叾瀹炲彧鏈夊湪鍔犺澆欏甸潰鍚庯紝鎴戜滑鐐瑰嚮鍒板脊鍑鴻繖孌墊椂闂撮〉闈㈡病鏈夎閲嶆柊鍔犺澆鐨勬儏鍐典笅錛屽脊鍑虹殑紿楀彛鎵嶄笉浼?xì)琚樌L錛佽繖涔熷氨鏄錛屽啓鍦ㄦ湇鍔″櫒鎺т歡鐨勫洖浼犱簨浠墮噷鐨剋indow.open閮戒細(xì)琚樆姝€?br /> <br /> 緇х畫Google瑙e喅鍔炴硶錛屽湪鍒嗘瀽浜嗗嚑縐嶈В鍐蟲柟娉曞茍榪涜瀵規(guī)瘮涔嬪悗錛屽彂鐜版渶綆鍗曟湁鏁堢殑鏂規(guī)硶濡備笅錛?br /> 鍦╳indow.open()鍑芥暟涓鍔犱竴涓弬鏁幫紝灝唗arget璁劇疆涓?#8216;self’錛?br /> 鍗蟲敼涓轟嬌鐢細(xì) window.open(link,'_self');<br /> 闂瑙e喅銆?/p> <br /> <img src ="http://www.tkk7.com/sealyu/aggbug/239429.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/sealyu/" target="_blank">seal</a> 2008-11-08 17:16 <a href="http://www.tkk7.com/sealyu/archive/2008/11/08/239429.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>瀵笷ckEditor緙栬緫鍣ㄥ湪MAXTHON嫻忚鍣ㄤ笅閫夋嫨鏈嶅姟鍣ㄦ枃浠跺璇濇鏄劇ず涓嶆甯哥殑鏀硅繘 -...錛堣漿杞斤級http://www.tkk7.com/sealyu/archive/2008/04/10/192009.htmlsealsealThu, 10 Apr 2008 14:53:00 GMThttp://www.tkk7.com/sealyu/archive/2008/04/10/192009.htmlhttp://www.tkk7.com/sealyu/comments/192009.htmlhttp://www.tkk7.com/sealyu/archive/2008/04/10/192009.html#Feedback0http://www.tkk7.com/sealyu/comments/commentRss/192009.htmlhttp://www.tkk7.com/sealyu/services/trackbacks/192009.html 鎬濊礬灝辨槸鍩轟簬IE鍐呮牳鐨勬祻瑙堝櫒閲囩敤妯℃佸璇濇寮瑰嚭嫻忚鏈嶅姟鍣ㄧ獥鍙o紝鍏朵粬鐨勪粛鐒秝indow.open涓嶅彉 1:淇敼"fckeditor"editor"dialog"common"fck_dialog_common.js
 1 function OpenFileBrowser( url, width, height )
 2 {
 3     // oEditor must be defined.
 4 
 5     var iLeft = ( oEditor.FCKConfig.ScreenWidth  - width ) / 2 ;
 6     var iTop  = ( oEditor.FCKConfig.ScreenHeight - height ) / 2 ;
 7 
 8     var sOptions = "toolbar=no,status=no,resizable=no,dependent=yes,scrollbars=yes" ;
 9     sOptions += ",width=" + width ;
10     sOptions += ",height=" + height ;
11     sOptions += ",left=" + iLeft ;
12     sOptions += ",top=" + iTop ;
13 
14     // The "PreserveSessionOnFileBrowser" because the above code could be
15     // blocked by popup blockers.
16     if ( oEditor.FCKConfig.PreserveSessionOnFileBrowser && oEditor.FCKBrowserInfo.IsIE )
17     {
18         // The following change has been made otherwise IE will open the file
19         // browser on a different server session (on some cases):
20         // http://support.microsoft.com/default.aspx?scid=kb;en-us;831678
21         // by Simone Chiaretta.
22         var oWindow = oEditor.window.open( url, 'FCKBrowseWindow', sOptions ) ;
23 
24         if ( oWindow )
25         {
26             // Detect Yahoo popup blocker.
27             try
28             {
29                 var sTest = oWindow.name ; // Yahoo returns "something", but we can't access it, so detect that and avoid strange errors for the user.
30                 oWindow.opener = window ;
31             }
32             catch(e)
33             {
34                 alert( oEditor.FCKLang.BrowseServerBlocked ) ;
35             }
36         }
37         else
38             alert( oEditor.FCKLang.BrowseServerBlocked ) ;
39     }
40     else
41     {    
            //榪欓噷鏄慨鏀歸儴鍒?br />
42         if(oEditor.FCKBrowserInfo.IsIE)
43         {
44             window.showModalDialog(url+"&rdm="+new Date(),window,"status:false;dialogWidth:"+width+"px;dialogHeight:"+height+"px""");
45         }
46         else
47         {
48             window.open( url, 'FCKBrowseWindow', sOptions ) ;
49         }
50     }
51 }

2:淇敼"fckeditor"editor"filemanager"browser"default"frmresourceslist.html
function OpenFile( fileUrl )
{
    
if( window.dialogArguments)
    {
        window.dialogArguments.SetUrl( fileUrl ) ;
        window.close() ;
        window.dialogArguments.focus() ;
    }
    
else
    {    
        window.top.opener.SetUrl( fileUrl ) ;
        window.top.close() ;
        window.top.opener.focus() ;    
    }
}


seal 2008-04-10 22:53 鍙戣〃璇勮
]]>
FireFox 涓?window.close()鏈夋椂涓嶈兘鍏抽棴 闂鐨勮В鍐?/title><link>http://www.tkk7.com/sealyu/archive/2008/04/10/192007.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Thu, 10 Apr 2008 14:51:00 GMT</pubDate><guid>http://www.tkk7.com/sealyu/archive/2008/04/10/192007.html</guid><wfw:comment>http://www.tkk7.com/sealyu/comments/192007.html</wfw:comment><comments>http://www.tkk7.com/sealyu/archive/2008/04/10/192007.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.tkk7.com/sealyu/comments/commentRss/192007.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/sealyu/services/trackbacks/192007.html</trackback:ping><description><![CDATA[<div>鏈榪戝仛欏圭洰鐨勬椂鍊欑鍒頒竴涓棶棰橈細(xì)</div> <div>鍦╦s閲岄潰浣跨敤window.close()錛孖E涓嬪伐浣滄甯革紝浣嗘槸FireFox涓嬫湁鏃跺彲浠ワ紝鏈夋椂涓嶈銆?/div> <div>鎼滅儲鍙戠幇錛屽彲浠ヨ繖鏍瘋В鍐籌細(xì)</div> <div><script   language="javascript"   type="text/javascript">   <br />     <br />   function   closeWindow()   {   <br />     <br />   window.open('','_parent','');   <br />     <br />   window.close();   <br />     <br />   }   <br />     <br />   </script>     <br />   <a   href="javascript:closeWindow();">Close   Window</a></div> <div> </div> <div>鍦ㄥ墠闈㈠姞涓鍙?nbsp; window.open('','_parent','');   </div> <div>浣滅敤涓猴細(xì)</div> <div>fool   the   browser   into   thinking   that   it   was   opened   with   a   script   <br />   This   opens   a   new   page,   (non-existent),   into   a   target   frame/window,   (_parent   which   of   course   is   the   window   in   which   the   script   is   executed,   so   replacing   itself),   and   defines   parameters   such   as   window   size   etc,   (in   this   case   none   are   defined   as   none   are   needed).   Now   that   the   browser   thinks   a   script   opened   a   page   we   can   quickly   close   it   in   the   standard   way…</div> <img src ="http://www.tkk7.com/sealyu/aggbug/192007.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/sealyu/" target="_blank">seal</a> 2008-04-10 22:51 <a href="http://www.tkk7.com/sealyu/archive/2008/04/10/192007.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://57gt.com" target="_blank">天天天欲色欲色WWW免费</a>| <a href="http://jundaflex.com" target="_blank">亚洲日韩精品A∨片无码</a>| <a href="http://www907ii.com" target="_blank">精品亚洲成a人片在线观看少妇</a>| <a href="http://7788xxx.com" target="_blank">男男黄GAY片免费网站WWW</a>| <a href="http://tzkanglong.com" target="_blank">aⅴ在线免费观看</a>| <a href="http://tzkanglong.com" target="_blank">国产亚洲av片在线观看播放</a>| <a href="http://scycho.com" target="_blank">国产精品无码亚洲精品2021 </a>| <a href="http://51porn3.com" target="_blank">亚洲av伊人久久综合密臀性色</a>| <a href="http://dazngt.com" target="_blank">豆国产96在线|亚洲</a>| <a href="http://dfcnpc.com" target="_blank">国产成人精品免费视频动漫</a>| <a href="http://sdzhly.com" target="_blank">亚洲gv猛男gv无码男同短文</a>| <a href="http://luyifeile.com" target="_blank">日韩电影免费在线观看网址 </a>| <a href="http://66h99.com" target="_blank">无人在线直播免费观看</a>| <a href="http://321fafa.com" target="_blank">精品国产亚洲一区二区三区</a>| <a href="http://taixin668.com" target="_blank">免费无码婬片aaa直播表情</a>| <a href="http://otkaxap.com" target="_blank">女人毛片a级大学毛片免费</a>| <a href="http://s4lm0x.com" target="_blank">亚洲视频日韩视频</a>| <a href="http://68996500.com" target="_blank">久久精品免费观看</a>| <a href="http://lhtjdj.com" target="_blank">超清首页国产亚洲丝袜</a>| <a href="http://87fulitv.com" target="_blank">美女视频黄频a免费观看</a>| <a href="http://rushiruhua.com" target="_blank">午夜寂寞在线一级观看免费</a>| <a href="http://100357.com" target="_blank">亚洲人成综合在线播放</a>| <a href="http://www-44455588.com" target="_blank">91成人在线免费视频</a>| <a href="http://ge2hao.com" target="_blank">国产av无码专区亚洲av桃花庵</a>| <a href="http://97aimeili.com" target="_blank">xxxxx做受大片视频免费</a>| <a href="http://yixinbanks.com" target="_blank">全部免费a级毛片</a>| <a href="http://jiezinet.com" target="_blank">亚洲AV无码之国产精品</a>| <a href="http://477077.com" target="_blank">女人18特级一级毛片免费视频</a>| <a href="http://kan63.com" target="_blank">亚洲国产中文在线视频</a>| <a href="http://www-66409b.com" target="_blank">最近免费字幕中文大全视频</a>| <a href="http://njchxf.com" target="_blank">亚洲av福利无码无一区二区</a>| <a href="http://666fzw.com" target="_blank">99久久免费国产精品热</a>| <a href="http://55118885.com" target="_blank">奇米影视亚洲春色</a>| <a href="http://xieehuomh.com" target="_blank">一本到卡二卡三卡免费高</a>| <a href="http://www2019rz.com" target="_blank">亚洲国产成人乱码精品女人久久久不卡</a>| <a href="http://cc45987.com" target="_blank">亚洲成av人在线观看网站 </a>| <a href="http://jaubus.com" target="_blank">久久久精品国产亚洲成人满18免费网站 </a>| <a href="http://guhey.com" target="_blank">麻豆69堂免费视频</a>| <a href="http://yangguang882.com" target="_blank">国产又粗又长又硬免费视频</a>| <a href="http://508009.com" target="_blank">亚洲国产精品无码久久98</a>| <a href="http://6t23.com" target="_blank">免费观看的毛片手机视频</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>