Capturing a function
-
I have a page where I need to trigger a function (I'll call hideBox) when another function (which I will call unChecked) is triggered. So let's say unChecked is called when a checkbox is clicked, as soon as unChecked runs, I need hideBox to run as well. The catch here is that i do not have access to the .js that holds the code for unChecked, and even if I did, I know it is being used by several other pages and I can't risk messing them up in the process. To further complicate things, I can't change any of the properties on the element that calls unChecked since the server side code is really picky about that sort of thing (the rest of the functionality breaks if I change any aspect of the input element. Needless to say, I did not write it.) I have tried just binding the event with jQuery, but jQuery actually changes the attribute array in the DOM, which screws up the post-back behavior. I have done this exact thing before, but that was using prototype, which isn't an option here (and was for another company so I can't go back and see what I did). Any ideas?
______________________ Oh Hamburgers!
-
I have a page where I need to trigger a function (I'll call hideBox) when another function (which I will call unChecked) is triggered. So let's say unChecked is called when a checkbox is clicked, as soon as unChecked runs, I need hideBox to run as well. The catch here is that i do not have access to the .js that holds the code for unChecked, and even if I did, I know it is being used by several other pages and I can't risk messing them up in the process. To further complicate things, I can't change any of the properties on the element that calls unChecked since the server side code is really picky about that sort of thing (the rest of the functionality breaks if I change any aspect of the input element. Needless to say, I did not write it.) I have tried just binding the event with jQuery, but jQuery actually changes the attribute array in the DOM, which screws up the post-back behavior. I have done this exact thing before, but that was using prototype, which isn't an option here (and was for another company so I can't go back and see what I did). Any ideas?
______________________ Oh Hamburgers!
If you don't have access and can't change anything there is nothing you can do. :rolleyes:
I know the language. I've read a book. - _Madmatt
-
If you don't have access and can't change anything there is nothing you can do. :rolleyes:
I know the language. I've read a book. - _Madmatt
-
I have a page where I need to trigger a function (I'll call hideBox) when another function (which I will call unChecked) is triggered. So let's say unChecked is called when a checkbox is clicked, as soon as unChecked runs, I need hideBox to run as well. The catch here is that i do not have access to the .js that holds the code for unChecked, and even if I did, I know it is being used by several other pages and I can't risk messing them up in the process. To further complicate things, I can't change any of the properties on the element that calls unChecked since the server side code is really picky about that sort of thing (the rest of the functionality breaks if I change any aspect of the input element. Needless to say, I did not write it.) I have tried just binding the event with jQuery, but jQuery actually changes the attribute array in the DOM, which screws up the post-back behavior. I have done this exact thing before, but that was using prototype, which isn't an option here (and was for another company so I can't go back and see what I did). Any ideas?
______________________ Oh Hamburgers!
I know of a way that may work, pending on if this hideBox should always override the unChecked when its javascript file is included. You could opt to override the unChecked javascript method as follows:
var unChecked = (function() {
var original_unChecked = unChecked;original\_unChecked(); hideBox();
});
Its not the neatest way to do it but will do what you want.