I have requirement where I have to load the content of JSP dynamically. And this has to happen within the single page.
now my problem in from the layout tree a tree will be displayed dynamically after the button on the top portion of the page. Once the tree is loaded a link will come called 'Add New Node' on click of which i need to replace the content of div - 'nodeDetailsDiv' with the html generated from another JSP. and that has to be used to save the data to db. I am using ajax here for the call.
Above is the script for dynamic loading. But document.getElementById('nodeDetailsDiv').innerHTML = req.responseText; at this line i am getting an error stating 'Unkonwn runtime error.'
Can you please let me know about jQuery, as I am new to jQuery and AJAX, if possible to begin with novice level of how to's. I have studied a bit on ajax but not fully sure of how to work with it.
And in Ajax call the if page being loaded contains "form" element then also this will generate a run time error. My requirement is I already have a form associated with a jsp, now i am loading
a secondary jsp containing another form element. for example DoctypeEdit.jsp is one where i have some fields that are to be entered by user, once he clicks on proceed button, another jsp will be loaded called TreeView.jsp, where an xml tree will be shown in the form of collapsible format.
Now here in this tree I have added a link called "Add New Node" on click of which an ajax call has to happen which hits the action classes and fetches few details from db. Once details are fetched the data will be displayed in form of drop down list. And these dropdown lists are supposed to be in a "<form>" element.
But if I include the form element in third jsp i.e "CustomNodeDetails.jsp" ajax call fails and throws a Unknown runtime error.