Results 1 to 3 of 3

Thread: Tracking window.open location

  1. #1
    Join Date
    Sep 2008
    Posts
    119
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default Tracking window.open location

    Ok,

    so let's say I have the following javascript window.open set.

    Code:
    window.open ("http://www.wtfe.com", "mywindow","status=1,width=350,height=150");
    Now, I have given this window the id of "mywindow", but the question is, can the http location be tracked through the window id?

    Scenario: A user goes from one of my pages opened via javascript to another site, can I know which location they are visiting?

    If so, this present some interesting options for keyword research, but also secutiry issues as well. It seems to me like it is possible though.

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Code:
    <script type="text/javascript">
    window.onload=function(){
    document.getElementById('test').onclick=function()
    	{
    	var winObj=window.open('http://www.google.com','mywin','height=300,width=300');
    	alert(winObj.name);
    	return false; // Cancel any event from this point  foward
    	}
    }
    </script>
    <a href="#" id="test">Test</a>
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. #3
    Join Date
    Sep 2008
    Posts
    119
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by rangana View Post
    Code:
    <script type="text/javascript">
    window.onload=function(){
    document.getElementById('test').onclick=function()
    	{
    	var winObj=window.open('http://www.google.com','mywin','height=300,width=300');
    	alert(winObj.name);
    	return false; // Cancel any event from this point  foward
    	}
    }
    </script>
    <a href="#" id="test">Test</a>
    This shows the name of the window in firefox, but the url (location.href) is display as about:blank. I am not sure that communication of document.window is allowed at all. The closest I have found for cross domain scripting is use of fragment identifiers.

    example - http://www.tagneto.org/blogcode/xframe/ui2.html

    this is also a very nice example - http://www.tagneto.org/blogcode/xfra..._1223608221578
    Last edited by Falkon303; 10-10-2008 at 03:10 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •