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

append script #4818

Closed
wineSu opened this issue Dec 23, 2020 · 2 comments
Closed

append script #4818

wineSu opened this issue Dec 23, 2020 · 2 comments

Comments

@wineSu
Copy link

wineSu commented Dec 23, 2020

<div class="test"></div>
<div class="test"></div>
<script type="text/javascript">
	$('.test').append('<script>alert(0)')
</script>

I want to pop it twice, but just once

ygj6 added a commit to ygj6/jquery that referenced this issue Dec 23, 2020
@mgol mgol added Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. Manipulation labels Dec 24, 2020
@timmywil timmywil removed the Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. label Jan 4, 2021
@timmywil
Copy link
Member

timmywil commented Jan 4, 2021

Thanks for opening an issue. This is intended behavior. It's usually a mistake to execute an appended script more than once.

@timmywil timmywil closed this as completed Jan 4, 2021
@timmywil
Copy link
Member

timmywil commented Jan 4, 2021

If you really want the script to execute more than once, you can use https://api.jquery.com/jQuery.globalEval/ directly.

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

No branches or pull requests

3 participants