• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with javascript array and undefined values in Internet explorer

 
Marcel Jacome
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, i am facing a big problem concerning javascript and internet explorer. I have been working on a virtual keyboard and everything works fine in all browsers except internet explorer 6 and up. The problem is that the elements of the arrays in my program turn out to be undefined. If i try the same program in a different browser , it works perfectly.
The code is as follows:



Pressing the button labeled "MAYUS." , the program changes the keys' values from lowercase to uppercase and viceversa, but this funcionality does not work in internet explorer.

What can i do to make it work for IE ?

Thanks in advance

 
Marcel Jacome
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can copy and paste the code into an html file and run it. The problem lies in these functions



In the code above , the array arr[] exists before entering the for loop, once inside the loop , the elements are undefined.


The same happens here in this function where i am changing an arrays' elements to uppercase



Thanks for your help
 
Marcel Jacome
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anything to do at all??? Should i use a library like jquery to solve this problem??? are there more options??
Any ideas?? thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64718
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Few people are going to red through almost 500 lines of code. You might attract more people to your issue if you pare the problem down to a smaller code fragment and be very precise about what the issue is.
 
Marcel Jacome
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It was easier than i thought , just used the onfocus method exposed by struts layout and it worked.
 
Marcel Jacome
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as the javascript and the undefined array elements , i just made both arrays global and solved the issue with IE.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic