unknown runtime error in IE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • vp.softverm@gmail.com

    unknown runtime error in IE

    hi all in the follwing part of code am getting the unknown runtime
    error at <select>

    any help ............... ............... ............

    Org.getCategori es({callback:fu nction(cat) {
    var begin="<select name='categoryl ist' id='categorylis t'
    onchange='eval( this.value);'>" ;
    var opt="<option value=\"\" >Select Category</option>";
    for(var i=0; i<cat.length; i++)
    {
    var optid="catid"+i ;
    opt+="<option
    value='javascri pt:loadFields(" +cat[i].id+")' >"+cat[i].name+"</
    option>";
    }
    var finalStr=begin+ opt+"</select";
    try{

    document.getEle mentById("catse lect").innerHTM L = finalStr;

    } catch(ex){
    alert(ex.messag e);
    }
    }, async:false});

  • GArlington

    #2
    Re: unknown runtime error in IE

    On May 26, 11:30 am, vp.softv...@gma il.com wrote:
    hi all in the follwing part of code am getting the unknown runtime
    error at <select>
    >
    any help ............... ............... ............
    >
    Org.getCategori es({callback:fu nction(cat) {
    var begin="<select name='categoryl ist' id='categorylis t'
    onchange='eval( this.value);'>" ;
    var opt="<option value=\"\" >Select Category</option>";
    for(var i=0; i<cat.length; i++)
    {
    var optid="catid"+i ;
    opt+="<option
    value='javascri pt:loadFields(" +cat[i].id+")' >"+cat[i].name+"</
    option>";
    }
    var finalStr=begin+ opt+"</select";
    try{
    >
    document.getEle mentById("catse lect").innerHTM L = finalStr;
    >
    } catch(ex){
    alert(ex.messag e);
    }
    }, async:false});
    Simplify your functions...
    I suspect that you are missing a quote " somewhere...

    Comment

    • Legaev Andrey

      #3
      Re: unknown runtime error in IE

      On May 27, 3:49 pm, GArlington <garling...@tis cali.co.ukwrote :
      On May 26, 11:30 am, vp.softv...@gma il.com wrote:
      >
      >
      >
      hi all in the follwing part of code am getting the unknown runtime
      error at <select>
      >
      any help ............... ............... ............
      >
      Org.getCategori es({callback:fu nction(cat) {
      var begin="<select name='categoryl ist' id='categorylis t'
      onchange='eval( this.value);'>" ;
      var opt="<option value=\"\" >Select Category</option>";
      for(var i=0; i<cat.length; i++)
      {
      var optid="catid"+i ;
      opt+="<option
      value='javascri pt:loadFields(" +cat[i].id+")' >"+cat[i].name+"</
      option>";
      }
      var finalStr=begin+ opt+"</select";
      try{
      >
      document.getEle mentById("catse lect").innerHTM L = finalStr;
      >
      } catch(ex){
      alert(ex.messag e);
      }
      }, async:false});
      >
      Simplify your functions...
      I suspect that you are missing a quote " somewhere...
      Try to remove "javascript :" prefix inside "value" attribute. Function
      eval() accept valid JavaScript code, but value: will generate syntax
      error.

      Comment

      • Thomas 'PointedEars' Lahn

        #4
        Re: unknown runtime error in IE

        Legaev Andrey wrote:
        On May 27, 3:49 pm, GArlington <garling...@tis cali.co.ukwrote :
        >On May 26, 11:30 am, vp.softv...@gma il.com wrote:
        >>hi all in the follwing part of code am getting the unknown runtime
        >>error at <select>
        >>any help ............... ............... ............
        >>Org.getCatego ries({callback: function(cat) {
        >> var begin="<select name='categoryl ist' id='categorylis t'
        >>onchange='eva l(this.value);' >";
        >>[...]
        >> opt+="<option
        >>value='javasc ript:loadFields ("+cat[i].id+")' >"+cat[i].name+"</
        >>option>";
        >>[...]
        >
        Try to remove "javascript :" prefix inside "value" attribute. Function
        eval() accept valid JavaScript code, but value: will generate syntax
        error.
        `javascript:' is a LabelStatement. It will only cause a syntax error with
        eval() if LabelStatements are not supported by the implementation. However,
        this is unlikely as it requires an implementation of ECMAScript Ed. 1 or 2.
        Nevertheless, the LabelStatement is unnecessary here.

        Please learn how threaded discussions on Usenet work and reply to the
        posting that you are directly referring to. This is even possible with
        Google Groups' flawed Web interface.


        PointedEars
        --
        realism: HTML 4.01 Strict
        evangelism: XHTML 1.0 Strict
        madness: XHTML 1.1 as application/xhtml+xml
        -- Bjoern Hoehrmann

        Comment

        Working...