Eval() function not working on Safari...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shravan88k
    New Member
    • Feb 2013
    • 6

    Eval() function not working on Safari...

    I am trying to fetch a dynamic variable something like

    Code:
    eval("variable" + number)
    On IE this evaluates fine. But Safari returns null every time!

    I also tried

    Code:
    window["variable" + number]
    But that does not help either...

    Please help....
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Can you post some more of your code, i.e. where you define this variable and where/when you're attempting to access this variable?

    Comment

    • gits
      Recognized Expert Moderator Expert
      • May 2007
      • 5390

      #3
      as far as i'm aware - eval works in all browsers - so to give a useful hint we need to see more of the code. since eval should always be avoided and is never needed in 'normal' javascripts - except when it comes to handle json-responses - that code should be replaced/improved anyway.

      Comment

      Working...