1: 2: 3:
window.ontabschanged = function() { alert('Tab Changed'); }
1: 2: 3: 4: 5: 6: 7: 8: 9:
window.ontabschanged = function() { alert('First Task'); } window.ontabschanged = function() { alert('Second Task'); } window.ontabschanged = function() { alert('Third Task'); }
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26:
<script type="text/javascript"> var addToEvent = function(method) { var cachedEvt = window.ontabschanged; if (typeof cachedEvt !== 'function') window.ontabschanged= method; else { window.ontabschanged= function() { if (cachedEvt) cachedEvt(); method(); } } }; addToEvent(function() { alert('First Task'); }); addToEvent(function() { alert('Second Task'); }); addToEvent(function() { alert('Third Task'); }); </script>