javascript - Can I get the current URL without an address bar? -


i use code below current url, , hash id has after forward slash domain. current url of page loaded in iframe means there's no address bar of course. how go doing this?

the code i'm using now:

var currenturl = (document.url); var part = currenturl.split("slash")[1]; alert(part); // alerts "xdas2" !!! 

for security reasons, can url long contents of iframe, , referencing javascript, served same domain. long true, work:

document.getelementbyid("iframe_id").contentwindow.location.href 

if 2 domains mismatched, you'll run cross site reference scripting security restrictions.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -