Some browsers will treat <button>
as a submit button and submit to the same page regardless of the button being a child of a form or not.
Change to
$('button').on('click', function(e){
e.preventDefault();
$("#youtube").append('<iframe width="200" height="100" src="https://www.youtube.com/embed/zoMYU_nOGNg?rel=0&showinfo=0&enablejsapi=1" frameborder="0" allowfullscreen=""></iframe>');
});
or add type="button"
to it.
If you DO have a form, instead do make the button a submit button and prevent the default action on the form submit:
$('form').on('submit', function(e){
e.preventDefault();
$("#youtube").append('<iframe width="200" height="100" src="https://www.youtube.com/embed/zoMYU_nOGNg?rel=0&showinfo=0&enablejsapi=1" frameborder="0" allowfullscreen=""></iframe>');
});
There is no other reason for the page to reload. Your code should not and indeed does not reload anything in Chrome