-
Notifications
You must be signed in to change notification settings - Fork 200
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
[question] jQuery with moon #222
Comments
the problem was in the router, since when i clicked on the router-link that lead me to the /admin page, jQuery is still loaded and the function that trigger the button exist in browser's console , so when i tape again on the adresse or refresh somethings happened in the moon router then it works!
am i messing something? |
When Moon Router loads a new page, instead of actually navigating to a new page, it changes the URL and updates the page using JavaScript. The button is likely being replaced with a new one when Moon builds the DOM — this is why Moon is not compatible with JQuery in most cases because it needs full control of the DOM. This is also the case with other frameworks. I'd suggest attaching the event with |
thx :) <3 |
No problem! |
now it works ,i wrapped jQuery code into function and pass it into onclick native event inside admin moon componenet and it work like a charm :p, thx for your answer and for <3 moon <3 |
Hey, i'm using moon cli and after generating the project i'm working with moon router then i face this problem. after including jQuery script into index.html and jQuery click function for a button, if i change the router to /admin and i click on button that being attached already with jQuery's click it wont work, until i refresh the page. any solution?
The text was updated successfully, but these errors were encountered: