jquery - Wrap content in a Div with javascript without iframe refreshing -
jquery - Wrap content in a Div with javascript without iframe refreshing -
basically want wrap content on page in div.
i can using wrap function in jquery issue have few iframes in content contain advertising , when wrap content refreshes iframes.
from can tell because behind scenes cloning content wrapped new div.
html
<div class="content"> <iframe src="http://something.com/ads"></iframe> </div>
js
$(content).wrap('awesome_container');
ideally slot in open div tags before content div , few close div tags afterwards can't seem add together divs page without adding close tags.
does know of way around issue?
cheers
instead of removing html or making re-create of it, see if can desired result using jquery's detach() allow whatever events have associated element , children still function afterwards. may plenty preserve iframe object instead of killing off.
var orphan = $(selector).detach() someparent.html(orphan);
let me know if helps :)
javascript jquery html
Comments
Post a Comment