469,360 Members | 1,807 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,360 developers. It's quick & easy.

unknown runtime error in IE

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[i].id+")' >"+cat[i].name+"</
option>";
}
var finalStr=begin+opt+"</select";
try{

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

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

Jun 27 '08 #1
3 1955
On May 26, 11:30 am, vp.softv...@gmail.com wrote:
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[i].id+")' >"+cat[i].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...
Jun 27 '08 #2
On May 27, 3:49 pm, GArlington <garling...@tiscali.co.ukwrote:
On May 26, 11:30 am, vp.softv...@gmail.com wrote:
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[i].id+")' >"+cat[i].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.
Jun 27 '08 #3
Legaev Andrey wrote:
On May 27, 3:49 pm, GArlington <garling...@tiscali.co.ukwrote:
>On May 26, 11:30 am, vp.softv...@gmail.com wrote:
>>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[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
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Ivan Debono | last post: by
2 posts views Thread by Pablo | last post: by
reply views Thread by Sccr18 | last post: by
22 posts views Thread by Josť Teixeira Junior | last post: by
10 posts views Thread by rwalrus | last post: by
21 posts views Thread by sheldonlg | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.