471,831 Members | 1,347 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,831 software developers and data experts.

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 1998
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
NeoPa
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.