PDA

View Full Version : Another DomHelper Question



INeedADip
20 Oct 2006, 12:43 PM
I am trying to do something like this:



var tr = {
tag: 'td',
children : [{
tag: 'a',
href: "javascript:jFunc('string1{0}', 'string2{0}', 0, 130);",
children: [{...}]
}]
}
var template = YAHOO.ext.DomHelper.createTemplate(tr);


My problem is in the "href" attribute. I've also tried things like:

href: "javascript:jFunc(\'string1{0}\', \'string2{0}\', 0, 130);"
or
href: 'javascript:jFunc("string1{0}", "string2{0}", 0, 130);'

I'm having trouble passing strings into my javascript functions. Is there another way to attack this?

jack.slocum
20 Oct 2006, 12:45 PM
You have to encode them. " would probably work.

INeedADip
20 Oct 2006, 12:49 PM
I should have thought about that before posting...

Thanks, that worked.