unknown runtime error in IE

V

vp.softverm

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

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

Org.getCategories({callback:function(cat) {
var begin="<select name='categorylist' id='categorylist'
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='javascript:loadFields("+cat.id+")' >"+cat.name+"</
option>";
}
var finalStr=begin+opt+"</select> ";
try{

document.getElementById("catselect").innerHTML = finalStr;

} catch(ex){
alert(ex.message);
}
}, async:false});
 
G

GArlington

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

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

Org.getCategories({callback:function(cat) {
var begin="<select name='categorylist' id='categorylist'
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='javascript:loadFields("+cat.id+")' >"+cat.name+"</
option>";
}
var finalStr=begin+opt+"</select> ";
try{

document.getElementById("catselect").innerHTML = finalStr;

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


Simplify your functions...
I suspect that you are missing a quote " somewhere...
 
L

Legaev Andrey

hi all in the follwing part of code am getting the unknown runtime
error at <select>
any help ..........................................
Org.getCategories({callback:function(cat) {
var begin="<select name='categorylist' id='categorylist'
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='javascript:loadFields("+cat.id+")' >"+cat.name+"</
option>";
}
var finalStr=begin+opt+"</select> ";
try{

document.getElementById("catselect").innerHTML = finalStr;
} catch(ex){
alert(ex.message);
}
}, 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.
 
T

Thomas 'PointedEars' Lahn

Legaev said:
hi all in the follwing part of code am getting the unknown runtime
error at <select>
any help ..........................................
Org.getCategories({callback:function(cat) {
var begin="<select name='categorylist' id='categorylist'
onchange='eval(this.value);'>";
[...]
opt+="<option
value='javascript:loadFields("+cat.id+")' >"+cat.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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top