www.webdeveloper.com
Results 1 to 3 of 3

Thread: Duplicate data property in object literal error when sourcing with chrome

Hybrid View

  1. #1
    Join Date
    Jan 2006
    Location
    Palmer Alaska
    Posts
    132

    Question Duplicate data property in object literal error when sourcing with chrome

    When sourcing a javascript file in chrome I get the following error message
    Duplicate data property in object literal not allowed in strict mode
    And it seems to indicate the following function :
    Code:
     IsUInt: function(field,control,ctx) {
        var strValidChars = "0123456789,",
            strChar,i = 0, max = 0,
            blnResult = true,
            strString = field.value,
            tmpAry = strString.split("."),
            fieldLabel = control.label;
    		strString = tmpAry[0];  // get rid of any decimal points
        for ( i = 0, max = strString.length;i < max && blnResult === true; i++) {
          strChar = strString.charAt(i);
          if (strValidChars.indexOf(strChar) == -1) {
            return ctx.tryAgain(field,"An input field near the following text:\n" + "\"" +  
                                fieldLabel + "\""  +  
    														"\nrequires a unsigned WHOLE NUMBER (no decimals please!).");
            }
          }
        field.value = strString;
        return true;
        },
    Yet I do not get the error message when running jslint
    Any ideas?
    TIA
    tim

  2. #2
    Join Date
    Jan 2006
    Location
    Palmer Alaska
    Posts
    132

    Exclamation

    Well, I have found the problem, but it raises another question:
    I had mistakenly duplicated the function. I found that firefox gave
    a clearer error message. But why didn't jslint catch it?

  3. #3
    Join Date
    Mar 2013
    Posts
    4
    Where the problem is? Can you please explain as i am unable to get it.
    ____________________
    esourcing information

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles