How do I get the current iframe location from within the iframe?
I've seen solutions like
top.document.getElementById('iframe_a').src
But the problem is, that I don't know the Iframes ID. My Applica开发者_开发问答tion is running as a Gmail-Gadget and therefore I don't know which ID Google will generate.
So how can I get the URL of my gadget?
Using JQuery will also be fine.
If your script is executed within an iframe, location.href
should do it. You might want to access the location
object in more detail tho.
精彩评论