开发者

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

开发者 https://www.devze.com 2023-02-28 00:30 出处:网络
My iframe is having a url with a hash value开发者_如何学JAVA 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 has

My iframe is having a url with a hash value开发者_如何学JAVA 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

0

精彩评论

暂无评论...
验证码 换一张
取 消