Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 589539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:26:05+00:00 2026-05-13T15:26:05+00:00

I am trying to do something similar to the Clipper application here http://www.polyvore.com/cgi/clipper I

  • 0

I am trying to do something similar to the Clipper application here http://www.polyvore.com/cgi/clipper

I can make the iframe appear in another website (cross domain). But I cannot make the “close” button to work.

This is what I used but it doesn’t work for cross domain (basically remove the iframe element)

window.parent.document.getElementById('someId').parentNode.removeChild(window.parent.document.getElementById('someId'));    

Can you help? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:26:05+00:00Added an answer on May 13, 2026 at 3:26 pm

    You should use a library that abstracts this (e.g. http://easyxdm.net/wp/ , not tested). Fragment ID messaging may not work in all browsers, and there are better approaches, such as postMessage.

    However, your example (Clipper) is using a hack called fragment id messaging. This can be cross-browser, provided the page containing your iframe is the top level. In other words, there are a total of two levels. Basically, the child sets the fragment of the parent, and the parent watches for this.

    This is a similar approach to Clipper’s:

    parent.html

    <html>
    <head>
    <script type="text/javascript">
    function checkForClose()
    {
        if(window.location.hash == "#close_child")
        {
          var someIframe = document.getElementById("someId");
          someIframe.parentNode.removeChild(someIframe);
        }
        else
        {
          setTimeout(checkForClose, 1000)
        }
    }
    setTimeout(checkForClose, 1000);
    </script>
    </head>
    <body>
    <iframe name="someId" id="someId" src="child.html" height="800" width="600">foo</iframe>
    </body>
    </html>
    

    child.html:

    <html>
    <head>
    <script type="text/javascript">
    setTimeout(function(){window.parent.location.hash = "close_child";}, 5000);
    </script>
    <body style="background-color: blue"></body>
    </html>
    

    EDIT2: Cross-domain and independently controlled are different. I dug into the (heavily minified/obfuscated) Polyvore code to see how it works (incidentally, it doesn’t in Firefox). First remember that bookmarklets, such as the Clipper, live in the context of the page open when they start. In this case, the bookmarklet loads a script , which in turn runs an init function which generates an iframe, but also runs:

    Event.addListener(Event.XFRAME, "done", cancel);
    

    If you digg into addListener, you’ll find (beautified):

    if (_1ce2 == Event.XFRAME) {
                            if (!_1cb3) {
                                _1cb3 = new Monitor(function () {
                                    return window.location.hash;
                                },
                                100);
                                Event.addListener(_1cb3, "change", onHashChange);
                            }
                        } 
    

    cancel includes:

    removeNode(iframe);
    

    Now, the only remaining piece is that the iframe page loads another script with a ClipperForm.init function that includes:

    Event.addListener($("close"), "click", function () {
                Event.postMessage(window.parent, _228d, "done");
            });
    

    So we see clearly they are using fragment ID messaging.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement something similar to what http://www.ancestry.com has, but I'm not sure
I'm trying to do something similar to http://www.lukew.com/ff/content/simpletable1.gif . I created my structure like
I am trying to do something similar to http://www.winktoolkit.org/previews/63/ As you can see from
Im trying to make something similar to twitpic.com's email submission feature. Their address schema
I´m trying to make something similar to the downloads panel of Transmission BT (here
I'm trying to do something similar to www.wanderfly.com . Basically the end goal is
I'm trying to build something similar to http://demo.instagram.com ( Real-time Photo Updates ) using
I am trying to do something similar to this app (Bottom Tab). http://itunes.apple.com/gb/app/westfield-london/id409824812?mt=8 Basically
I am trying to obtain something similar to the share this on... menu here
I'm trying to accomplish something similar to the fellow here , but going with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.