I'm developing a enterprise application with java & hibernate & spring mvc in the server side and using jquery in the client side (not a SPA).
Now in the search page i use ajax and get only json response, but i don't want to write something like this below in every search or pagination request.
function(ajaxData) {
....
$('#search').html('' +
'<div class="search-container">' +
'<div class="search-item">' +
'<div class="title-item">'+ajaxData.title+'</div>' +
...
...
'</div>' +
'</div>'
)
....
}
I think it's easy to use jsx with a react or vue component just in this page to refresh the results.
I want also reuse some html blocks and i think it will be easy with react or vue
I used to build a little SPA project and it's all about npm and webpack and bundling, but i really don't want to use them since i have a multi page application and it's very suitable for my project.
I think the same thing facebook is doing, they use react but facebook is not a SPA.
How can i achieve this hybrid approach ?