SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Jan 2005
    Location
    UK
    Posts
    539
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    getting location from iframe

    I have a page with an iframe, i set the src via js which works fine.
    I need to get the location of that iframe on every load and set an input text box with it...

    The iframe is actually of a website on a different domain, and so i navigate to the url via a proxy (http://www.mydomain.com/proxy.php?ur...urltovisit.com)
    This keeps it same domain and should allow me to work this it (avoiding cross-domain restrictions)

    I had this working in FF:
    Code:
           <iframe .....
     	onload='var str =unescape(window.myiframe.location);
    	str = str.substring(44); 
    	str = str.slice(0, -5);
    	document.form["myiframelocation"].value = str;'>
    Strangely, it has just suddenly stopped working and i'm now getting the usual uncaught exception errors.

    Thing i dont understand is that it should work as i'm using a proxied version of the webpage, so it is bascially seen as being on my own domain...why doesn't this work?

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    do you have a sample of the page? What errors do you get? Usual uncaught exceptions doesn't really help much.



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
  •