简体   繁体   中英

add meta tag on Iframe parent head element

I have need to add meta tag element on Iframe parent head element, I had tried

window.parent.$('head').append('sometext');

this one was working on the source file and iframe file in the same folder, but it was not working on the cross domain, it causes

window.parent.$ is not a function issue.

$('head', window.parent.document).append("test")

you'll probably want to use .data() instead of .append() though http://api.jquery.com/data/

The second argument of $() is the search context, default is document .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM