• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with javascript array and undefined values in Internet explorer

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic