| Author |
Javascript not running on next page in displaytag.tld
|
Eric Juneau
Greenhorn
Joined: Jul 13, 2009
Posts: 28
|
|
I have a JSP that has two tables, each uses displaytag. One of them is hidden (you switch back and forth between them like tabs) within a div. I have some javascript that runs when the page loads that hides table 2, and when you click either tab, it hides the appropriate div and shows the one you clicked un.
But when you click the next page of the table, the page refreshes, but the javascript does not run. In fact, it looks like all the javascript on this page has disappeared completely. Does anyone know why? And how do I re-enable/recover the javascript functionality?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56179
|
|
|
If the page is refreshing from the server, then it will have whatever's sent. Have you checked the response to see if the JavaScript is there?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Eric Juneau
Greenhorn
Joined: Jul 13, 2009
Posts: 28
|
|
|
After further research, I got it. I had the id attribute of the display:table tag the same for both tables. Apparently, it doesn't mind this when first loading the page, but it cared when I tried to change pages on one table. I changed the id= of the second table and now it works.
|
 |
 |
|
|
subject: Javascript not running on next page in displaytag.tld
|
|
|