Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto load our old js on load event #13

Open
AmBplus opened this issue Aug 6, 2024 · 2 comments
Open

auto load our old js on load event #13

AmBplus opened this issue Aug 6, 2024 · 2 comments

Comments

@AmBplus
Copy link

AmBplus commented Aug 6, 2024

first of all thank you for providing this package ,
i have a asp.net core razor pages app and writing so many js code , now if i want to import them to blazor ssr with this way , need to go every js and wrapp them up inside of export function onLoad() {} , there is a way to tell auto loading the js file on some event like onLoad() ?
on mean somthing like

and no need to write the export function onload anymore and this js file just run on load

@AmBplus AmBplus changed the title auto load preview js on load event auto load our old js on load event Aug 6, 2024
@MackinnonBuck
Copy link
Owner

Hi @AmBplus,

If all you want to do is load a script dynamically, you don't need to wrap it in another script that defines an onLoad() handler. You can just reference the script directly from the <PageScript> component. The onLoad, onUpdate, and onDispose callbacks are optional, and only exist to implement functionality that responds to navigation events.

@AmBplus
Copy link
Author

AmBplus commented Sep 24, 2024

TNX , in asp.net core mvc or razor pages , we have asp-apend-version = true , so i don't need to change the file by myself , in this package we have something similar ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants