top.location from iframe with src ssl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Amzul
    New Member
    • Oct 2007
    • 130

    top.location from iframe with src ssl

    hello all.

    is there a way to get the window.top.loca tion if the current location is https://...?

    parent.html will call am iframe with src="https://www.testtest.co m/sun.html"

    sun.html
    should alert the url that opened it.

    without the https its working.

    is there a way?

    thanks
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Is it from the same domain?

    Comment

    • Amzul
      New Member
      • Oct 2007
      • 130

      #3
      no, its not
      the parent can be http://www.google.com
      the iframe can be https://www.aol.com

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Normally, http wouldn't be allowed cross-domain either. Are you testing locally?

        Comment

        • Amzul
          New Member
          • Oct 2007
          • 130

          #5
          thanks for you patines,
          not sure what you mean by localy :\
          i just buikd the iframe and i want other websites to use it,
          i also want to know what wbsite uses it
          still no one use it

          Comment

          • Amzul
            New Member
            • Oct 2007
            • 130

            #6
            no edit :\

            i just test it and its not working even in http :(
            not sure what i saw that i thought it did.

            anyway is there a away to round it?

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #7
              Yes, that's what I thought. There are ways around it. One is to serve the page from your domain, e.g. by using Curl. If you control both domains, there was a recent thread that you could look at. If I find it, I'll post it here.

              Comment

              • Amzul
                New Member
                • Oct 2007
                • 130

                #8
                Curl is a nice idea and it might even work :) but i only have control over the iframe and not on the pages that will call it, i am not even sure that its php page that will call it.

                i know i can always ask to attached the domain to the iframe src and then
                window.location .search
                but i dont want to trust other for my logs.
                i want my code to be able to do that

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  #9
                  In that case, it's not going to work. The way Curl would've worked is that you control the main page domain and serve the iframe content from your domain.

                  Comment

                  • Amzul
                    New Member
                    • Oct 2007
                    • 130

                    #10
                    beside curl, is there away?

                    Comment

                    • acoder
                      Recognized Expert MVP
                      • Nov 2006
                      • 16032

                      #11
                      Perhaps what you can do is have the sites include your iframe via a script, so the script would create the iframe and pass on the URL to the src.

                      Comment

                      • Amzul
                        New Member
                        • Oct 2007
                        • 130

                        #12
                        yeah good idea
                        thanks acoder

                        Comment

                        Working...