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?
Asked
Active
Viewed 72 times
0
-
Everything's possible I suppose. Could you please show us your attempts to achieve this? – Kyll Jul 07 '15 at 08:23
-
Found this link, might be what I need http://stackoverflow.com/questions/4770296/load-different-js-files-for-different-pages-or-load-together, will do @Kyll – Ranson Namba Jul 07 '15 at 08:24
-
You could drop a cookie then increment the value every time the cookie is read. – Patrick Gunderson Jul 07 '15 at 08:24
1 Answers
1
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.