firefox - Javascript, aliases and IE -


In an attempt to save space, I have created a complete group of all aliases for the function in my code. It works fine in FF, but now I'm trying to add support for IE and it's not happy.

  j = string; F0 = j.fromCharCode; J = j.prototype; J.f1 = j.indexOf; J.f2 = j.lastIndexOf; J.f3 = j.concat; J.f4 = j.substring; Function aka (c, e) {return function () {return c [e] .apply (c, logic);}}} w = window.location; D = document; B = document.body; F5 = aka (d, "createElement"); F6 = aka (b, "appendChild"); F7 = aka (d, "getElementById"); ... etc.  

I know that the alias () function does not work in IE is an alternative method that works in both browsers?

This is one of those answers that does not answer directly to your question, but I think That it will help you:

You should write your code without all the small variables and surnames. Write it completely because it will be very easy to maintain

then , when you move the code into production, keep your code through a miner which Aliyasing and small variables for you.

You can try to do any of these two for you (there are many good people too):

  1. (Turn on 'shrub variables')

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -