Closed misog closed 2 years ago
Thanks for opening the two new issues!
Yes, also DOMContentLoaded
handling is a pain in the plain vanilla Ajaxify.
I think that is what's causing the problem because of this entry in your error log:
iFn https://4nf.org/ajaxify.js:79
Maybe have a look at this currently closed issue ->
(it is closed at the moment but still an issue, I'm afraid)
I will check out the links to PJAX etc. that you have kindly provided...
Had a look especially at this:
Very interesting - especially the synthetic checking for document.write
with match()
.
However, I would not like to overhaul the complete script handling at the moment...
Hi there,
are you happy with your workaround (replacing the DOMContentLoaded
handler) or is there anything else I can do?
Hi, I use emoji JS plugin which is correctly re-initialized by ajaxify but CSS of the plugin was broken. So I went to set up PHP testing site to reproduce the issue but encountered JS issue: Here is code and preview: https://phpsandbox.io/e/x/ymp6u?layout=EditorPreview&defaultPath=%2F&theme=dark&showExplorer=no&openedFiles=
However open directly the URL for JS errors in console: https://ymp6u.ciroue.com/
Edit: The problem was solved when I removed
addEventListener('DOMContentLoaded', (event) => {
and just let the initialization run in<script>
. Here is the issue I had: https://github.com/arvgta/ajaxify/issues/229 Edit 2: Regarding this issue, maybe custom script execution handler could be allowed (ex. evalScripts(element)). Or to change script execution to one of the other PJAX projects:MoOx https://github.com/MoOx/pjax/blob/master/lib/execute-scripts.js https://github.com/MoOx/pjax/blob/master/lib/eval-script.js
PaperStrike https://github.com/PaperStrike/Pjax/blob/main/src/libs/executeScripts/Script.ts https://github.com/PaperStrike/Pjax/blob/main/src/libs/executeScripts/index.ts
Or https://github.com/falsandtru/pjax-api
Or https://stackoverflow.com/questions/1197575/can-scripts-be-inserted-with-innerhtml