I want to run the JavaScript function on my page, but only when the tab is displayed.
There are actually two questions. I don't use ajax tabs, so would I put my JavaScript in the "load" or "show" callback if I want the code to run only after the tab is displayed?
Depending on the answer above, what would my code look like to do the following:
I want it to be like this
- when displaying / loading tabs
- → paste javascript here.
- when tab2 is displayed / loaded
- → insert different javascript here.
- when tab3 is displayed / loaded
- → insert different javascript here.
- and etc.
source
share