How can I re-initialize vanilla js codes whenever the page load #568
Unanswered
ahmadzissa
asked this question in
Q&A
Replies: 2 comments
-
I don't know anything about themeforst but are you loading the app.js in the root.blade.php? That files stays in browser and doesn't get reloaded on partial page loads. Also, your routes need to use the Splade middleware. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm loading the theme.js file in resources/js/app.js file
I'm using Splade middleware for all routes
For Root file I have these codes
is there any way to make it load with every action like vue js ? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Laravel Version: 10.10
PHP Version: 8.1.6
Splade Version: 1.4.16
Description:
I purchased a theme from themeforst, and it uses vanilla js. The js works in the first-page load, but whenever I do any action like clicking on the nav bar or clicking on table pagination, it stops working because the js does not load again when the dom updates.
is there any way to load the js file each time the page loads ( dom change) just like vue js ?
from app.js
import "../css/app.css";
import "@protonemedia/laravel-splade/dist/style.css";
import "./app.css";
import './themejs.js' // this is the file I need to reload
Beta Was this translation helpful? Give feedback.
All reactions