[mochikit] Re: How to get Signal.connect code rendered via .innerHTML replacement to work?

2007-10-05 Thread wavydavy

On Oct 5, 7:05 am, John Lorance [EMAIL PROTECTED] wrote:
 The Problem:
 onclick_mybutton= function(e)
 {
 return myJavaScriptFunction(this.form, target_id, e);
 }

 Now, I get everything rendered just fine (so I can see the button
 represented by btn_left.png)... however, the browser doesn't execute
 the new function (seen above) on click... .

Not sure, but:

 - IIRC, 'this' in the context of the event handler is bound to the
object that fired the event (your input). If not it's bound to the
'onclick_mybutton' function. Either way, neither have a 'form'
attribute AFAICS.

 - where's target_id come from?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~--~~~~--~~--~--~---



[mochikit] Re: How to get Signal.connect code rendered via .innerHTML replacement to work?

2007-10-05 Thread Bob Ippolito

On 10/4/07, John Lorance [EMAIL PROTECTED] wrote:

 The Problem:
 I have a button on a page that results in getting HTML back from the
 server which contains something like the following (result['content']
 (below) contains the following):


innerHTML doesn't execute script. You could try something like this:

var elem = getElement(target_id);
elem.innerHTML = result['content'];
var script_tags = getElementsByTagAndClassName(script, null, elem);
for (var i = 0; i  script_tags.length; i++) {
eval(scrapeText(script_tags[i]));
}

I'm not sure if that works in all of the browsers, make sure to give
it a try in the ones you care about.

-bob

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~--~~~~--~~--~--~---