eval() in firefox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • radhakoteru
    New Member
    • Apr 2008
    • 3

    eval() in firefox

    eval(String) not working in firefox
  • radhakoteru
    New Member
    • Apr 2008
    • 3

    #2
    eval() in firefox

    how to use eval() function to work in firefox

    Comment

    • gits
      Recognized Expert Moderator Expert
      • May 2007
      • 5388

      #3
      threads merged ... don't double post the same question ...

      to your problem: eval() is definitly working in FF ... post the code that makes the problem ... probably we need to see more then the eval line especially where you create/retrieve the string that you want to evaluate ... give an example for that string

      kind regards

      Comment

      • radhakoteru
        New Member
        • Apr 2008
        • 3

        #4
        here is the problem with code

        [CODE=javascript]if(questiontype == 'DA'){

        var monthValue = "document.getEl ementById('mont h_"+sectionid+" _"+questionid+" ')";
        var month = trimString(eval (monthValue).va lue);
        var dateValue = "document.getEl ementById('date _"+sectionid+"_ "+questionid+"' )";
        var date = trimString(eval (dateValue).val ue);
        var yearValue = "document.getEl ementById('year _"+sectionid+"_ "+questionid+"' )";
        var year = trimString(eval (yearValue).val ue);[/CODE]
        Last edited by gits; Apr 2 '08, 08:59 AM. Reason: added code tags

        Comment

        • gits
          Recognized Expert Moderator Expert
          • May 2007
          • 5388

          #5
          you just don't need to use eval here ... just use:

          [CODE=javascript]var month_id = 'month_' + sectionid + '_' + questionid;
          var month = document.getEle mentById(month_ id).value;[/CODE]
          typically eval() is never needed, except when you need to eval json-data.

          kind regards

          Comment

          Working...