Today in a project, I used AJAX to fetch a data list from the backend and display it. At the same time, I retrieved the total course duration and the total time already studied from that data. The data was passed to an iframe, which used amCharts to display bar charts and pie charts. However, the iframe refused to refresh.

Referring to the code below, after assigning a value to the iframe’s src, wait for the iframe’s load event to complete, and then do a little trick. (Assign a value to a hidden variable on the page.)
Reposted from: http://www.streamcave.com/article/javascript/201008/jquery_iframe_load.html
After an iframe in a web page finishes loading, you might want to perform some tasks. For example, display “Loading” somewhere before the iframe content changes, and then change the text to “Load complete” after it finishes. So how should you handle this?
In jQuery, the iframe load completion event is `load`, not `ready`.
Attachment download:
https://www.cnop.net/uploadfile/2014/0319/20140319050509485.zip