Strange error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aaron

    #1

    Strange error

    I have 2 listbox server controls on my page that I've written a few js
    functions to move the options between them. All works fine, except
    when I call my function to re-sort the lists. After the items are
    removed from one list and added to another, the following is called
    passing the "list to be sorted" in as an object. If I put a simple
    alert in after the sort method, it works fine. Once I remove the
    alert, I get the "Unspecifie d error" blah blah blah.

    Any thoughts?
    Thanks
    - Aaron

    function sortList(l){
    var holdValue = new Array()
    for(j=0;j<l.len gth;j++){
    holdValue[j] = l[j].value
    }

    holdValue.sort( )
    //UNREM THIS.. AND IT WORKS FINE
    //alert("Looking OK")
    l.length=0
    for(j=0;j<holdV alue.length;j++ ){
    var o = new Option(holdValu e[j],holdValue[j])
    l.add(o)
    }
    }
  • Thomas 'PointedEars' Lahn

    #2
    Re: Strange error

    Aaron wrote:
    [color=blue]
    > I have 2 listbox server controls on my page[/color]

    What server-side application are you using?
    [color=blue]
    > that I've written a few js functions to move the options between them.
    > All works fine, except when I call my function to re-sort the lists.[/color]

    Where do you call the function(s)?
    [color=blue]
    > After the items are removed from one list and added to another, the
    > following is called passing the "list to be sorted" in as an object. If
    > I put a simple alert in after the sort method, it works fine. Once I
    > remove the alert, I get the "Unspecifie d error" blah blah blah.[/color]

    "Does not work" is a useless error description. [psf 4.11]


    PointedEars

    Comment

    • Steven Daedelus

      #3
      Re: Strange error

      In article <6f94f4d.040528 1006.22c9d21b@p osting.google.c om>,
      ajames_2@hotmai l.com (Aaron) wrote:
      [color=blue]
      > I have 2 listbox server controls on my page that I've written a few js
      > functions to move the options between them. All works fine, except
      > when I call my function to re-sort the lists. After the items are
      > removed from one list and added to another, the following is called
      > passing the "list to be sorted" in as an object. If I put a simple
      > alert in after the sort method, it works fine. Once I remove the
      > alert, I get the "Unspecifie d error" blah blah blah.
      >
      > Any thoughts?
      > Thanks
      > - Aaron
      >
      > function sortList(l){
      > var holdValue = new Array()
      > for(j=0;j<l.len gth;j++){
      > holdValue[j] = l[j].value
      > }
      >
      > holdValue.sort( )
      > //UNREM THIS.. AND IT WORKS FINE
      > //alert("Looking OK")
      > l.length=0
      > for(j=0;j<holdV alue.length;j++ ){
      > var o = new Option(holdValu e[j],holdValue[j])
      > l.add(o)
      > }
      > }[/color]

      Don't know if this is the source of the error, but you really ought to
      terminate your lines with semicolons.

      Comment

      Working...