We have a struts based application with jsp view. One of the web page after loading has iframes and nested frames. We want to get rid of them and thought of using div and Ajax instead. The page has around 7+ frames and we used 7+ ajax calls to load the data in each of them. Instead of src attribute in frames tag we used "data" attribute in div, added the url in them and used that url in ajax call.
For Example:
<div id="test" data-url="Required URL"></div>
<script>
var elm = document.getElementById("test");
$.ajax({
url: elm.dataset.url,
dataType: html,
success: function(data){
$("#test").html(data);
}
});
</script>
It would be like the first div is loaded and inside that content another div will be there and it will be loaded next and so on.
We are currently facing few issues like:
Do you think there is an efficient way to replace iframe/frames or to resolve these mentioned issues? Please do help. Thanks.