简体   繁体   中英

How can i get the hash value from an iframe src?

My iframe is having a url with a hash value when i do iframe.src it just gives me the url without the hash appended to it from the other domain. Can i read the entire url with the hash.

Not likely due to security constraints - I am surprised you can even get the URL

Can you show the code?

Sounds like a duplicate of How to get iframe contentWindow height in cross domain

var contentWnd = $('iframe').attr('contentWindow');
var hash = contentWnd.window.location.hash;

Adaptation of this answer: Get url from iframe and update hash in browser url

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