This article mainly introduces the Javascript code set as the homepage and favorites (it is compatible with IE, Firefox, chrome and other browsers ). For more information, see chrome, safari, and opara. the browser does not support "set as Homepage" and "add to Favorites ". so we can only try and catch it and give an error prompt! It's perfect.
In Internet Explorer, many people have encountered an error in
This article mainly introduces JavaScript image scaling code that is compatible with IE and Firefox, and involves related techniques related to JavaScript operations on image elements, for more information about how to use JavaScript to scale images that are compatible with IE and
Sort out some JavaScript IE and Firefox compatibility solutions, and have better ways to communicate with each other
1. document. form. item Problems(1) existing problems:
Many statements such as document. formName. item ("itemName") exist in the existing code and cannot be run in Firefox.
(2) solution:
Use document. formName. elements ["elementName"]
(3) Others
Summary of incompatibility and unified methods between IE and Firefox in Javascript zhoz
, Technical Development
, Comment (3)
, Reference (0)
, Reading (2127)
, Via original site
Large| Medium| Small
Reference address:
Note:
This address is valid only before 23:59:59 today.
Test todayCodeBut an error is reported in ff.The incompatibility and unified methods of IE and
In this article, the authors introduce 7 different JavaScript syntax in IE and Firefox.
1. CSS "Float" value
The most basic syntax for accessing a given CSS value is:
Object.style.property
, use the hump to replace a value with a connector, for example, to access a Value, we use the following syntax:
document.getElementById ("header"). style.backgroundcolor= "#ccc";
But since the word "float" is a
The project should be compatible with IE and Firefox. Let me summarize the differences between Javascript in IE and Firefox. I copied some content on the Internet and made some changes: -Element search Problems1. Document. All [name](1) Existing Problem: Firefox does not support document. All [name](2) solution: Use
The incompatibility and unified methods of IE and Firefox in JavaScript are summarized as follows:1. compatible with Firefox's outerhtml and FF, there is no outerhtml method. If (window. htmlelement ){
Htmlelement. Prototype. _ definesetter _ ("outerhtml", function (shtml ){
VaR r = This. ownerdocument. createRange ();
R. setstartbefore (this );
VaR df = R. createcontextualfragment (shtml );
This. parentnod
Window. event. keyCode is compatible with the specific implementation code of IE and Firefox as follows. If you are interested, refer to the following HTML code.
The Code is as follows:
Javascript code
The Code is as follows:
Function keyNumAll (evt ){// Compatible with IE and Firefox to obtain keyBoardEvent objectsEvt = (evt )? Evt: (window. event
In this article, the authors introduce 7 different JavaScript syntax in IE and Firefox.
1. CSS "Float" valueThe most basic syntax for accessing a given CSS value is: Object.style.property, using the hump to replace a value with a connector, for example, to access a document.getElementById ("header"). style.backgroundcolor= "#ccc";But since the word "float" is a JavaScri
support innerHTML, the solution can be as followsJS CodeRNG = Document.createrange ();el = document.getElementById (ElementID);Rng.setstartbefore (EL);Htmlfrag =rng.createcontextualfragment (content); while (El.haschildnodes ())//Clear original content, add new contentEl.removechild (El.lastchild);El.appendchild (Htmlfrag);IMG SRC Refresh IssueUnder IE you can use You can refresh the picture, but not in Firefox. The main problem is caching, which is
Sort out some solutions to the compatibility between JavaScript IE and Firefox, and have better methods for communication; 1. Document. Form. Item Problems
(1) existing problems:
Existing
Code There are many statements such as document. formname. Item ("itemname"), which cannot be run in Firefox.
(2) solution:
Use document. formname. elements ["elementname"]
(3)
JavaScript does not prompt to close the current page window, compatible with IEFirefoxChrome (closethecurrentpage%wwithoutconfirmbyjavascript, supportallbrowsers) in IE7/Firefox 3.0/Google Chrome pass the test
CloseDemo.htm
The Code is as follows:
ScriptVar browserName = navigator. appName;If (browserName = "Netscape "){Function closeme (){Window. open ('', '_ parent ','');Window. close ();}}Else{If (brow
In this article, I'll outline some of the different aspects of Internet Explorer and Firefox in JavaScript syntax.1. CSS "Float" propertyThe basic syntax for getting a specific CSS property for a given object is the Object.style property, and the properties of the hyphen are replaced by the camel name. For example, to get an background-color attribute for a div with the ID "header", we would use the followi
Even though it's time to use long string, dull, and different branch code to handle different browsers, occasionally, it is necessary to make some simple differentiation and target detection to ensure that a piece of code can run properly on the user's machine. In this article, the author introduces the differences between 7 JavaScript codes in IE and Firefox.
1. CSS "float" Value
The most basic syntax fo
In this article
Article The author introduces the differences between 7 JavaScript codes in IE and Firefox.
1. CSS "float" Value
The most basic syntax for accessing a given CSS value is: object. style. property, replace the value with a connector using the camper method. For example, to access the background-color value of
Document. getelementbyid ("Header"). style. backgroundcolor = "# CCC ";Howev
In this article, the author introduces the differences between 7 JavaScript codes in IE and Firefox.1. CSS "float" Value The most basic syntax for accessing a given CSS value is: object. style. property, replace the value with a connector using the camper method. For example, to access the background-color value of Document. getElementById ("header"). style. backgroundColor = "# ccc ";However, because the w
In this article, the author describes the differences between 7 JavaScript in IE and Firefox.
1. CSS "Float" value
The most basic syntax for accessing a given CSS value is: Object.style.property, using the hump to replace a value with a connector, for example, to access a
document.getElementById ("header"). style.backgroundcolor= "#ccc";
But since the word "float" is a
Despite the lengthy and annoying use of Javascript in historyCodeThe period of a specific browser with a block to mark has ended, but it is still necessary to occasionally use some simple code blocks and object detection to ensure that some code works normally on the user's machine.
This articleArticleInternet Explorer and Firefox have seven different aspects in Javas
Although the history of using lengthy and annoying code blocks in JavaScript to mark specific browsers has ended, however, it is necessary to occasionally use some simple code blocks and object detection to ensure that some code works normally on the user's machine.
BKJIA recommended reading: different performance of JavaScript in IE and FireFox
1. CSS "float" at
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.