www.webdeveloper.com
Results 1 to 7 of 7

Thread: IFrame problem :(((

  1. #1
    Join Date
    Aug 2005
    Posts
    9

    IFrame problem :(((

    Hi!

    (sorry for bad english)

    How I can find a iframe's address with java script?

    Start: <iframe src="http://google.com"> (user is clicking, clicking, clicking...)
    End: <iframe src="http://google.com/[i dont know, where is user?]">

    For sample, Look at this page please: http://www.polarhome.com:793/~azerk/google.html

    HELP PLEASE!

  2. #2
    Join Date
    Jan 2005
    Location
    Los Angeles, CA
    Posts
    4,887
    Code:
    <script type="text/javascript">
    onload=function(){
    alert(frames[0].src)
    alert(frames[1].src)
    }
    </script>

  3. #3
    Join Date
    Aug 2005
    Posts
    9
    Hi, this is don't work

    its here: http://www.polarhome.com:793/~azerk/google-2.html

  4. #4
    Join Date
    Jan 2005
    Location
    Los Angeles, CA
    Posts
    4,887
    Oh, sorry, I meant location.href
    Code:
    <script type="text/javascript">
    onload=function(){
    alert(frames[0].location.href)
    alert(frames[1].location.href)
    }
    </script>
    Last edited by Ultimater; 08-04-2005 at 01:54 PM.

  5. #5
    Join Date
    Aug 2005
    Posts
    9
    but don't work

    its here : http://www.polarhome.com:793/~azerk/google-2.html

    thanks for help

  6. #6
    Join Date
    Jan 2005
    Location
    Los Angeles, CA
    Posts
    4,887
    My second code will work if you change your frames URL to something in the same domain as your running script. Cross-domains don't work for security reasons in JavaScript.
    Simply change http://google.com into http://www.polarhome.com

  7. #7
    Join Date
    Aug 2005
    Posts
    9
    Hmm, I will try, more more

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles