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):
<input src="/static/images/btn_left.png" name="mybutton"
type="image" id="mybutton_id" value="somevalue" class="imagebutton">
<script type="text/javascript">
onclick_mybutton= function(e)
{
return myJavaScriptFunction(this.form, target_id, e);
}
MochiKit.Signal.connect("mybutton_id", "onclick",
onclick_mybutton);
</script>
This is then rendered to the page via something like:
getElement(target_id).innerHTML = result['content'];
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... . I know the above block of
code works fine as I have nearly identical blocks of code hooked up to
other buttons that are rendered on the initial page load.
What am I missing here? Does .innerHTML not render the HTML in the
same way as the original page load (in other words, ignoring the
Mochikit.Signal.connect.. call?)
Any help would be greatly appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---