Blog Archives
Difference between Firefox and IE for JavaScript
Web Design India
JavaScript is the language that enables multiple functionalities in WebPages and it differs from one browser to the other in the way it is implemented. Firefox and Internet Explorer are two browsers that are very popular nowadays and are competing with each other to provide a faster, more secure and enjoyable experience for Web Surfers, by providing different advantages. The differences in JavaScript coding are responsible for the running style of these browsers and their compatibility with other applications. We will discuss a few aspects from these to let you know what exactly separates Firefox and Internet Explorer when it comes to Java Scripting.
Settings
Firstly, Firefox has an advanced window for JavaScript Settings through which the permissions for JavaScript can be configured. Mozilla Firefox has more security locks as compared to IE (supported by JavaScript).
Features
The latest IE version in use (IE 8 ) boasts of better comprehensive developer tools that are built-in like HTML, CSS and tools for JavaScript editing and JavaScript profiling. But for other browsers such as Firefox, these tools need to be downloaded separately.
While Internet Explorer supports only the common standards used by websites; Firefox supports emerging standards like HTML5 and CSS3 as well.
Date Function
According to the ECMAScript specification followed by JavaScript, the method of getFullYear() (earlier getYear) is not compliant with Y2K. In Internet Explorer, this was changed to getFullYear() while Firefox retained the older method.
Debugging
Since Firefox came after IE, so it had solutions for many problems that plagued the former IE versions. One of these is the debugging option with Firefox browser, which solves many problems related to IE applications by an advanced console that even lets you evaluate the JavaScript. The coding for this is easily available on the internet.
Generating HTML
JavaScript can easily generate HTML from a string using the document.write function. Now if the document is in the SR mode (strict rendering), then parsing of the </script> tag takes place within the string and the Firefox’s parser will keep parsing till the closing tag is found for the <script> tag. This happens as the parser in the strict mode is not familiar with JavaScript but in quirks mod, the parser is aware of this. In Internet Explorer, none of this happens because it stays in quirks mode at all times due to its non-supporting feature for true XHTML.
Feature Differences in Current Versions
IE version 8.0 has remarkable improvements and support for JavaScript but it still scores only 20 out of 100 on the Acid3 test. Accelerators and WebSlices are supported for navigation and subscription features. Some other notable features include InPrivate privacy and filter for SmartScreen phishing.
Version 3.6
- Improved performance for JavaScript engine TraceMonkey
- Provides support for:
- -moz-background-size
- CSS property
- CSS Gradients
- Notifies about out-of-date plugins
What Lies Ahead
Internet Explorer 9 includes
- Faster JavaScript
- Enhanced support for
- CSS 3 selectors
- Border-radius CSS3 property
- Embedded ICC v2/v4 color profiles
Firefox 4.0 includes
- New Account Manager
- Improved notification function
- Enhanced application tabs
- Revamped extension manager
- Support new Javasript engine called JagerMonkey
- Better HTML and CSS3 support
Although JavaScript forms the base for both browsers but different coding makes one different from the other. The newer versions for Firefox and Internet explorer are to release later in this year and will pitch several features against each other, in a bid to compete for the user’s attention. Watch this space for further information, which we will update soon.
Quick JavaScript Tips and Practices
Web Design India
Java Script, one the most popular web programming languages, has expanded its significance not only among the general web authors and amateurs but even among the professional programmers because of the ease and efficiency it offers in the programming format. Inspite of it being the best programming language for web designing, not many know the salient features offered by it, apart from its common features. Some of the interesting tips, recommendations, and best practices for JavaScript coding are listed below, that would help you to use Java Script in new and refined form.
1. Defer Attribute
Using Defer Attribute gives extra time to the externally linked scripts to load, until the page completely loads. This is especially advantageous in case of Internet Explorer browser, the only one that currently supports a Defer. To add defer to the coding of the webpage, all you need to do is add defer=”defer” in your <script> tag and that will quickly take care of that problem.
Visual Example
<script type=”text/javascript” defer=”defer”></script>
2. C Data Section to avoid Validation Errors
If you are faced with regular Validation Errors in the designing format of your webpage, then this simple tip will be a savior for you. Merely use C Data Section to end your coding; this will significantly decrease the validation errors you generally face.
Visual Example
<div>
<p>
<script type=”text/javascript”>
//<![CDATA[
var my_variable = 100;
if (my_variable < 50) {
// do something here...
}
//]]>
</script>
</p>
</div>
3. Avoiding Java Key words
There are several words that are reserved as Keywords by Java Script, that hamper the programming, designing, loading and processing of the webpage. By avoiding the Java Keywords in your script, and using other custom identifiers in their place, you can ensure smooth operation of any Java coded Webpage.
Some of the common Java Script Keywords are listed below
- Break
- Case
- Catch
- Continue
- Default
- Delete
- Do
- Else
- Finally
- For
- Function
- If
- In
- Instanceof
- New
- Return
- Switch
- This
- Throw
- Try
- Typeof
- Var
- Void
- While
- With
4. Localized use of Variables
In any coding language, where multiple options are to be used on the same webpage, there is always a chance that the variable might be used by other codes for which it is not designed. This can be easily avoided, by localizing the use of variables for a particular operation or the function it has to perform. By localizing variables, you ensure that they are abolished as soon as the function is executed and cannot be used later by other codes.
5. Case Sensitive Custom Identifiers
All the custom identifiers used in Java Script Coding, are case sensitive and using different case for the same identifier in the code can create errors and operations glitches in the functioning of the webpage. So by avowing use of dual case in the code, you not only use formal and globally accepted form of identifiers but also ensure that you don’t accidentally declare two different variables when you actually meant to create just one.
Visual Example
var myVariable = “data”;
var myvariable = “more data”;
These are only few of the tips and practices that will make your work on JavaScript easier. You can explore many more of them.




