I am using JSP to render the HTML content. Once jsp is loaded on page, I want to reload a part of JSP to fill new content (content is already present) on button click. Is this right approach to take? Or this part should done in JS script?
Asked
Active
Viewed 28 times
0
-
Sounds like you need to use AJAX. Do you have a specific problem or something you have attempted? – James Jackson Mar 30 '19 at 12:11
-
Using jazva script is one correct way to go. Have a look at this answer : https://stackoverflow.com/questions/17886578/refresh-part-of-page-div – Julien Revault d'A... Mar 30 '19 at 12:12
-
@JamesJackson data get loaded in one go. I show only part of content coming from server. On button click i show the rest of content present. So not making an extra ajax call to fetch the data – rishabhjainps Mar 30 '19 at 12:22
-
But you can use an ajax and only use a portion of the response. – James Jackson Mar 30 '19 at 12:24
-
@JulienRevaultd'A... Thanks. For conformation a lot of data is there. It will okay to send data for jsp to js on button click then? – rishabhjainps Mar 30 '19 at 12:26
-
@JamesJackson any ref. where i can read up on this. Thanks – rishabhjainps Mar 30 '19 at 12:28
-
Have a look at this example : https://jsfiddle.net/GRMule/WQXXT/ – Julien Revault d'A... Mar 30 '19 at 12:30
-
If using jQuery you can use `$(response).filter('#someId');` – James Jackson Mar 30 '19 at 12:40
-
cool thanks @JulienRevaultd'A... ,@JamesJackson – rishabhjainps Mar 30 '19 at 13:10