S
stephen.cunliffe
Hi,
Okay, here's my problem...
I'm dynamically building some content (similar to this):
var fooObj = document.createElement('div');
fooObj.setAttribute('id', 'uniqueNumber');
etc.
The issue I have, is that I want to do (similar to this):
fooObj.setAttribute('onclick', 'func1();func2(' + some.dyn.reference +
');return false;');
Of course, it works like butta, in *Mozilla*, and *Opera*... but _IE_
just quietly ignores it...
-------------------
Now, I know I can use:
fooObj.click = nameOfFuncWithNoQuotesOrBrackets;
but, I'm limited to 1 (one) function, and *more* importantly, I can't
pass a parameter to the function... (IIRC)
-------------------
Looking for ideas... ;-)
Please keep in mind though...
a.) I *have* to dynamically create this element (it doesn't exist until
run-time)
b.) I *have* to be able to pass parameter(s)
c.) *Ideally* I would like to be able to call several consecutive
statements (e.g. any combo of js stmts / functions / returns), however
if I can call one function with parameters, I *suppose* I can make that
function in turn call the one(s) I need.
d.) Allthough I would really like this to work in IE too, if it turns
out that it can't, well, that's okay too... This would likely be the
'official' last straw in supporting this Browser for this mini-app.
(read: Debugging in IE is like shaving with a chainsaw... you *could*
do it, but why even try!)
Cheers,
Steve
Okay, here's my problem...
I'm dynamically building some content (similar to this):
var fooObj = document.createElement('div');
fooObj.setAttribute('id', 'uniqueNumber');
etc.
The issue I have, is that I want to do (similar to this):
fooObj.setAttribute('onclick', 'func1();func2(' + some.dyn.reference +
');return false;');
Of course, it works like butta, in *Mozilla*, and *Opera*... but _IE_
just quietly ignores it...
-------------------
Now, I know I can use:
fooObj.click = nameOfFuncWithNoQuotesOrBrackets;
but, I'm limited to 1 (one) function, and *more* importantly, I can't
pass a parameter to the function... (IIRC)
-------------------
Looking for ideas... ;-)
Please keep in mind though...
a.) I *have* to dynamically create this element (it doesn't exist until
run-time)
b.) I *have* to be able to pass parameter(s)
c.) *Ideally* I would like to be able to call several consecutive
statements (e.g. any combo of js stmts / functions / returns), however
if I can call one function with parameters, I *suppose* I can make that
function in turn call the one(s) I need.
d.) Allthough I would really like this to work in IE too, if it turns
out that it can't, well, that's okay too... This would likely be the
'official' last straw in supporting this Browser for this mini-app.
(read: Debugging in IE is like shaving with a chainsaw... you *could*
do it, but why even try!)
Cheers,
Steve