简体   繁体   中英

Render different JS file on each page refresh?

Doing a game in Pixi.JS and I need to know if it's possible to render a different JS file on each page refresh. I'll have the js file names stored in an array, and would like to iterate through the array and render the indexes js file each time the page refreshes. I'm using vanilla Javascript, is this possible?

Yes,it is achievable.

Store the counter locally,increment it till the length of the array and based on the current counter value load the js.

refer http://www.w3schools.com/html/html5_webstorage.asp

Conditionally load JavaScript file

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