function my_alert() {
alert("Hello");
}
If the above is inside a partial, it doesn't work when I call my_alert() from a onclick event of a button on the partial; it is as if the function is not defined. But if the above is inside the parent, it works.
However, if I change the function definition to below:
my_alert = function my_alert() {
alert("Hello");
}
It works if it's defined in a partial (But it doesn't work in IE).
If I just throw the below on a view:
alert("Hello");
It will show the alert message no matter it's on the partial or the parent.
I need to do more research on this. I think as long as the defined function is shown on page source, it should work. Can I have a script
section inside a div?