Hello, I'm beginning a project to edit replay files. I'm 'hacking' the replay viewer to add some additional functionalities.
Its a short question that would probably be better suited for a simple question simple answer thread but I can't seem to find one.
Right now, I'm running into some trouble with this line in replay files:
I wanted to host the replay-embed.js file somewhere else so I would be able to edit it.
heres what I tried to do:
The two files are identical, and as far as I understand, the file I host on github should still be able to get its dependencies from play.pokemonshowdown/js.
However, this does not work. The replay window just doesn't show up.
I have attached a html file and you can edit this line to confirm this behavior.
On another note, I tried messing with it and found out that
does not work (ridding the '+' part), while
does works.
I really don't understand whats the logic behind this.
I'm not familiar with html and js, so if there's a simple answer to this, >_<
(zipped html file attached as html files are not allowed)
Its a short question that would probably be better suited for a simple question simple answer thread but I can't seem to find one.
Right now, I'm running into some trouble with this line in replay files:
Code:
let daily = Math.floor(Date.now()/1000/60/60/24);document.write('<script src="https://play.pokemonshowdown.com/js/replay-embed.js?version'+daily+'"></'+'script>')
heres what I tried to do:
Code:
document.write('<script src="https://raw.githubusercontent.com/iwa-yasu/showdown_replay_editor/main/replay_embed.js"></'+'script>');
However, this does not work. The replay window just doesn't show up.
I have attached a html file and you can edit this line to confirm this behavior.
On another note, I tried messing with it and found out that
Code:
document.write('<script src="https://play.pokemonshowdown.com/js/replay-embed.js"></script>');
Code:
document.write('<script src="https://play.pokemonshowdown.com/js/replay-embed.js"></'+'script>');
I really don't understand whats the logic behind this.
I'm not familiar with html and js, so if there's a simple answer to this, >_<
(zipped html file attached as html files are not allowed)
Attachments
-
4.9 KB Views: 313