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

appendTo vs. self-closing tag jquery >= 3.5 #4830

Closed
santaclaus21 opened this issue Jan 13, 2021 · 1 comment
Closed

appendTo vs. self-closing tag jquery >= 3.5 #4830

santaclaus21 opened this issue Jan 13, 2021 · 1 comment

Comments

@santaclaus21
Copy link

Code:
$('<div class="popup" data-popup="iframe-1">' + '<div class="popup-flex">' + '<div class="popup-inner">' + '<iframe src="'+url+'" frameborder="0" height="100%" width="100%" />' + '<a class="popup-close" data-popup-close="iframe-1" href="#">&#10005;</a>' + '</div></div></div>').appendTo('body').fadeIn(600);

After this code there is nothing after appended iframe:

image

It was working fine before JQuery 3.5. But, if I replace self-closing iframe to <iframe....></iframe>, everything is working as expected:

$('<div class="popup" data-popup="iframe-1">' + '<div class="popup-flex">' + '<div class="popup-inner">' + '<iframe src="'+url+'" frameborder="0" height="100%" width="100%"></iframe>' + '<a class="popup-close" data-popup-close="iframe-1" href="#">&#10005;</a>' + '</div></div></div>').appendTo('body').fadeIn(600);

Result:
image

And now, code after iframe is not lost. Why ? I couldn't find any important notice in Jquery docs / appendTo.

@mgol
Copy link
Member

mgol commented Jan 13, 2021

Please read the issue template, it provides this issue as a frequently reported one. This is covered by the jQuery 3.5.0 blog post & the upgrade guide. Also, it's a duplicate of #4681, #4693, #4709, #4710, #4720, #4721, #4780 & #4823.

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

No branches or pull requests

2 participants