By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,401 Members | 1,381 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,401 IT Pros & Developers. It's quick & easy.

unknown runtime error in IE

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.