Saturday, December 19, 2009

ie vs ff on javascript

We all know how painful it is to deal with the standard differences when it comes to javascript programming across IE and Firefox. There can be many to be listed, but I’m going to list them out as a series of posts over time. These are going to be my findings, so correct any mistakes i may have.

Access DOM Object in an attached event
let’s say you have a link on the page that you want to attach an onclick event to
and assume addEvent is a method created to support both IE and FF

Under Firefox, if you want to access the linkObj, you can simply use “this”
linkObj.addEvent(”click”, function(){
alert(this.href);
})
Under IE, you can’t use “this” because “this” will referrer to the document object
instead, you have to use srcElement, and pass in e as an argument
linkObj.addEvent(”click”, function(e){
var thisObj=e.srcElement;
alert(thisObj.href);
});

4 comments:

  1. The thing about java in different platforms are the fundamental differences in codes for them.

    white label seo

    ReplyDelete
    Replies
    1. IEEE Project Domain management in software engineering is distinct from traditional project deveopment in that software projects have a unique lifecycle process that requires multiple rounds of testing, updating, and faculty feedback. A IEEE Domain project Final Year Projects for CSE system development life cycle is essentially a phased project model that defines the organizational constraints of a large-scale systems project. The methods used in a IEEE DOmain Project systems development life cycle strategy Project Centers in Chennai For CSE provide clearly defined phases of work to plan, design, test, deploy, and maintain information systems.


      This is enough for me. I want to write software that anyone can use, and virtually everyone who has an internet connected device with a screen can use apps written in JavaScript. JavaScript Training in Chennai JavaScript was used for little more than mouse hover animations and little calculations to make static websites feel more interactive. Let’s assume 90% of all websites using JavaScript use it in a trivial way. That still leaves 150 million substantial JavaScript Training in Chennai JavaScript applications.

      Delete
  2. And the same goes for other scripts and programming languages.
    web design perth

    ReplyDelete
  3. Right Finn and Melissa. Coding and other programming languages is essential for every web developer.
    los angeles seo

    ReplyDelete