简体   繁体   中英

Calling java script chrome and firefox

I am calling this script in a for loop

<script src="../../../data/novus/src/models/multiChart.js"></script>.

In firefox, the script is called for every iteration of the loop BUT

In chrome it only calls it once.

Is there a way to make chrome behave like firefox does. Am I doing something wrong with the way I'm calling it?

Thanks for your help

Caching?

Try this instead of your tag:

<script type="text/javascript">
    var cacheBuster = new Date().getTime();
    var s = '<script src="../../../data/novus/src/models/multiChart.js?_=' + cacheBuster +  '"></script>';
    document.write(s);
</script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM