if(!document.all){
//zzcv の ff ie 互換スクリプト
/* スクリプトによって解決されない問題と解決策:
2. IE では、() または [ を使用できます。 ] コレクション クラス オブジェクトを取得します。Firefox では、[] を使用してコレクション クラス オブジェクトを取得します。
3.通常の属性を取得する場合は、getAttribute() を使用してカスタム属性を取得することもできます。
解決策: getAttribute() を使用してカスタム属性を取得することのみが可能です。 🎜>4. IE では、HTML オブジェクトの ID をドキュメントの下位オブジェクトの変数名として直接使用できますが、Firefox では、HTML オブジェクト ID と同じ変数名を使用できません。は使用できますが、IE では使用できません。
解決策: document.idName の代わりに document.getElementById("idName") を使用します。エラーを減らすために、変数を宣言するときは常に var を追加してください。
6. input.type 属性は IE では読み取り専用ですが、input.type 属性は Firefox では読み取り/書き込み可能です。
8. IE では、showModalDialog および showModelessDialog を通じて開くことができます。 Firefox では、
9. Firefox の本体は、ブラウザによって body タグが完全に読み取られる前に存在することはできません。一方、IE の本体は、ブラウザによって body タグが完全に読み取られた後に存在する必要があります。
10.
//ドキュメント互換の
HTMLDocument.prototype.__defineGetter__("all",function(){
return this.getElementsByName("*");});
HTMLFormElement。 prototype.item=function(s){
return this.elements[s];};
HTMLCollection.prototype.item=function(s){
return this[s] };
//イベント互換
window.constructor.prototype.__defineGetter__("event",function(){
for(var o=arguments.callee.caller,e=null;o != null;o=o.caller){
e=o.arguments[0];
if(e&&(e instanceof Event))
return e;}
return null;}) ; 🎜>
window.constructor.prototype.attachEvent=HTMLDocument.prototype.attachEvent=HTMLElement.prototype.attachEvent=function(e,f){
this.addEventListener(e.replace(/^on/i ," "),f,false);};
window.constructor.prototype.detachEvent=HTMLDocument.prototype.detachEvent=HTMLElement.prototype.detachEvent=function(e,f){
this.removeEventListener( e.replace(/^on/i,""),f,false);};
with(window.Event.constructor.prototype){
__defineGetter__("srcElement ", function(){
return this.target;});
__defineSetter__("returnValue",function(b){
if(!b)this.preventDefault();}) ; 🎜>
__defineSetter__("cancelBubble",function(b){
if(b)this.stopPropagation();});
__defineGetter__("fromElement",function(){
var o=(this.type=="mouseover"&&this.personalTarget)||(this.type=="mouseout"&&this.target)||null;
if(o)
while( o. nodeType!=1)
o=o.parentNode; type=="mouseover"&&this.target)||(this.type=="mouseout"&&this.popularTarget)||null;
while(o.nodeType!=1)
o=o.parentNode;
return o;});
__defineGetter__("x",function(){
return this.pageX;});
__defineGetter__ ("y",function(){
return this.pageY;});
__defineGetter__("offsetX",function() {
return this.layerX;});
__defineGetter__("offsetY",function(){
return this.layerY;});
}
// ノードの操作互換性があります
with(window.Node.prototype){
replaceNode=function(o){
this.parentNode.replaceChild(o,this);}
RemoveNode=function(b) ){
if(b)
return this.parentNode .removeChild(this);
var range = document.createRange();
return this. parentNode.replaceChild(range.extractContents(),this);}
swapNode=function(o){
return this.parentNode.replaceChild(o.parentNode.replaceChild(this,o),this);}
contains=function(o) {
return o?((o==this)?true:arguments.callee(o.parentNode)):false;}
}
//HTML元素互換
with(window.HTMLElement .prototype){
__defineGetter__("parentElement",function(){
return (this.parentNode==this.ownerDocument)?null:this.parentNode;});
__defineGetter__("children",function(){
var c=[];
for(var i=0,cs=this.childNodes;i
c.push(cs[i]);}
return c;});
__defineGetter__("canHaveChildren",function(){
return !/^(area|base|basefont|col|frame|hr|img|br|input|isindex|link|meta|param) $/i.test(this.tagName);});
__defineSetter__("outerHTML",function(s){
var r=this.ownerDocument.createRange();
r.setStartBefore(this);
void this.parentNode.replaceChild (r.createContextualFragment(s),this);
return s;};
__defineGetter__("outerHTML",function(){
var as=this.attributes;
var str=" for(var i=0,al=as. length;i
str =" " as[i].name "="" as[i].value """;}
return this.canHaveChildren?str ">":str ">" this.innerHTML "" this.tagName ">";});
__defineSetter__("innerText",function(s){
return this.innerHTML=document.createTextNode(s);});
__defineGetter__("innerText",function(){
var r=this.ownerDocument.createRange();
r.selectNodeContents(this);
return r.toString();});
__defineSetter__("outerText",function(s){
void this.parentNode.replaceChild(document.createTextNode(s),this);
return s});
__defineGetter__("outerText",function(){
var r=this.ownerDocument.createRange();
r.selectNodeContents(this);
return r.toString();});
insertAdjacentElement=function(s,o){
return (s=="beforeBegin"&&this.parentNode.insertBefore(o,this))||(s=="afterBegin"&&this.insertBefore( o,this.firstChild))||(s=="beforeEnd"&&this.appendChild(o))||(s=="afterEnd"&&((this.nextSibling)&&this.parentNode.insertBefore(o,this.nextSibling) )||this.parentNode.appendChild(o)))||null;}
insertAdjacentHTML=function(s,h){
var r=this.ownerDocument.createRange();
r.setStartBefore(this);
this.insertAdjacentElement(s,r.createContextualFragment(h));}
insertAdjacentText=function(s,t){
this.insertAdjacentElement(s,document.createTextNode(t)); }
}
//XMLDOM 互換
window.ActiveXObject=function(s){
switch(s){
case "XMLDom":
document.implementation.createDocument.call(this,"text /xml","",null);
//domDoc = document.implementation.createDocument("text/xml","", null);
休憩;
}
}
XMLDocument.prototype.LoadXML=function(s){
for(var i=0,cs=this.childNodes,cl=childNodes.length;i
this.appendChild(this.importNode((new DOMParser()).parseFromString(s,"text/xml").documentElement,true));}
XMLDocument.prototype.selectSingleNode=要素。 prototype.selectSingleNode=function(s){
return this.selectNodes(s)[0];}
XMLDocument.prototype.selectNodes=Element.prototype.selectNodes=function(s){
var rt= [];
for(var i=0,rs=this.evaluate(s,this,this.createNSResolver(this.ownerDocument==null?this.documentElement:this.ownerDocument.documentElement),XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),sl =rs.snapshotLength;i
return rt;}
XMLDocument.prototype.__proto__.__defineGetter__("xml",function(){
try{
return new XMLSerializer().serializeToString(this);}
catch(e){
return document.createElement("div").appendChild(this.cloneNode(true)).innerHTML;}});
Element.prototype.__proto__.__defineGetter__("xml",function(){
try{
return new XMLSerializer().serializeToString(this);}
catch(e){
return document.createElement("div").appendChild(this.cloneNode(true)).innerHTML;}});
XMLDocument.prototype.__proto__.__defineGetter__("text",function(){
return this.firstChild.textContent;});
Element.prototype.__proto__.__defineGetter__("text",function(){
return this.textContent;});
Element.prototype.__proto__.__defineSetter__("text",function(s){
return this.textContent=s;});
}

去掉重复并排序的方法:1、使用“Array.from(new Set(arr))”或者“[…new Set(arr)]”语句,去掉数组中的重复元素,返回去重后的新数组;2、利用sort()对去重数组进行排序,语法“去重数组.sort()”。

本篇文章给大家带来了关于JavaScript的相关知识,其中主要介绍了关于Symbol类型、隐藏属性及全局注册表的相关问题,包括了Symbol类型的描述、Symbol不会隐式转字符串等问题,下面一起来看一下,希望对大家有帮助。

怎么制作文字轮播与图片轮播?大家第一想到的是不是利用js,其实利用纯CSS也能实现文字轮播与图片轮播,下面来看看实现方法,希望对大家有所帮助!

本篇文章给大家带来了关于JavaScript的相关知识,其中主要介绍了关于对象的构造函数和new操作符,构造函数是所有对象的成员方法中,最早被调用的那个,下面一起来看一下吧,希望对大家有帮助。

本篇文章给大家带来了关于JavaScript的相关知识,其中主要介绍了关于面向对象的相关问题,包括了属性描述符、数据描述符、存取描述符等等内容,下面一起来看一下,希望对大家有帮助。

方法:1、利用“点击元素对象.unbind("click");”方法,该方法可以移除被选元素的事件处理程序;2、利用“点击元素对象.off("click");”方法,该方法可以移除通过on()方法添加的事件处理程序。

本篇文章给大家带来了关于JavaScript的相关知识,其中主要介绍了关于BOM操作的相关问题,包括了window对象的常见事件、JavaScript执行机制等等相关内容,下面一起来看一下,希望对大家有帮助。

foreach不是es6的方法。foreach是es3中一个遍历数组的方法,可以调用数组的每个元素,并将元素传给回调函数进行处理,语法“array.forEach(function(当前元素,索引,数组){...})”;该方法不处理空数组。


ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

AI Hentai Generator
AIヘンタイを無料で生成します。

人気の記事

ホットツール

ドリームウィーバー CS6
ビジュアル Web 開発ツール

ゼンドスタジオ 13.0.1
強力な PHP 統合開発環境

SAP NetWeaver Server Adapter for Eclipse
Eclipse を SAP NetWeaver アプリケーション サーバーと統合します。

mPDF
mPDF は、UTF-8 でエンコードされた HTML から PDF ファイルを生成できる PHP ライブラリです。オリジナルの作者である Ian Back は、Web サイトから「オンザフライ」で PDF ファイルを出力し、さまざまな言語を処理するために mPDF を作成しました。 HTML2FPDF などのオリジナルのスクリプトよりも遅く、Unicode フォントを使用すると生成されるファイルが大きくなりますが、CSS スタイルなどをサポートし、多くの機能強化が施されています。 RTL (アラビア語とヘブライ語) や CJK (中国語、日本語、韓国語) を含むほぼすべての言語をサポートします。ネストされたブロックレベル要素 (P、DIV など) をサポートします。

AtomエディタMac版ダウンロード
最も人気のあるオープンソースエディター
