Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

105
Views
Replacing iframes and frames with div tag using ajax calls

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:

  • Sometimes, the script tags in the HTML data loaded by Ajax call are not working properly.
  • If there is any javascript error happens in the HTML data loaded by Ajax call, the script inside the success part of Ajax call doesn't work.
  • The same is working when frames are used. The browser back and forward button is not working with Ajax.

Do you think there is an efficient way to replace iframe/frames or to resolve these mentioned issues? Please do help. Thanks.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!