Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Dec 2010
    Posts
    44
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Arrow Close popup window on submission

    Hello,

    I'm trying to create a popup window that has another page embeded on it with an iframe. The page is a simple "voting" page that just displays a button to vote

    It uses the form method to submit the vote (if that helps)

    I would like for the popup window to automatically close when the vote is submitted

    Can anyone help me with this?

    Thank you

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,458
    Thanks
    76
    Thanked 4,373 Times in 4,338 Posts
    Do you really mean popup? As in window.open( ... )? Or do you mean a POPON, where a <div> is popped on top of the rest of the page?

    popups can and are blocked by popup blockers. popons cannot be blocked.

    And I really have to ask...
    Code:
    The page is a simple "voting" page that just displays a button to vote.
    So this is like elections in the old Soviet Union? You can vote, but you can only vote for one candidate? Or you can only approve some action the Supreme Soviet has already taken? <grin/>
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    New Coder
    Join Date
    Dec 2010
    Posts
    44
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Old Pedant View Post
    Do you really mean popup? As in window.open( ... )? Or do you mean a POPON, where a <div> is popped on top of the rest of the page?

    popups can and are blocked by popup blockers. popons cannot be blocked.

    And I really have to ask...
    Code:
    The page is a simple "voting" page that just displays a button to vote.
    So this is like elections in the old Soviet Union? You can vote, but you can only vote for one candidate? Or you can only approve some action the Supreme Soviet has already taken? <grin/>
    I want the one that opens a new small window
    And this is the page i want to use: http://goo.gl/L2Kgl

    Thanks!

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,458
    Thanks
    76
    Thanked 4,373 Times in 4,338 Posts
    Ahhh...you want to cheat, in other words.

    The good news (to that site, though not to you) is that you can't.

    Have you heard of "cross site scripting"? It is *BLOCKED* by all modern browsers.

    It means that you can *ONLY* use JavaScript to read or write or change content on another page *IF* the page comes from the SAME DOMAIN (and same security level, by the way, and some other less common restrictions).

    So that button exists on the page http://bops2.gotop100.com/in.php and that means that *ONLY* scripts that are on pages that *ALSO* come from the URL http://bops2.gotop100.com can read (or in this case respond to the button push on) that page.

    And no, you can't push some other button or do something else that would, in turn, push the button on that page.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #5
    New Coder
    Join Date
    Dec 2010
    Posts
    44
    Thanks
    2
    Thanked 0 Times in 0 Posts
    What if i were to embed the page as a widget, would ot be possible to make it dissapear if it's clicked on?

  • #6
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,458
    Thanks
    76
    Thanked 4,373 Times in 4,338 Posts
    I don't know, and quite frankly I don't care. Is it really *THAT* important to you to collect votes for yourself?

    I don't really care if you cheat on a game like this, but I just have no interest in such things.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #7
    New Coder
    Join Date
    Dec 2010
    Posts
    44
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Lol no im not cheating, this is just a way for people t be able to vote staright from my site, this is not cheating in any way

  • #8
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,458
    Thanks
    76
    Thanked 4,373 Times in 4,338 Posts
    I think I have to disagree.

    You are concealing the fact that the button you are showing is actually part of the much larger page and you are concealing the fact that the normal action of the button is to cause the user to enter the main page of the site. In other words, it's a way for the site owner to help drive traffic to his site.

    So you are subverting it strictly for the purpose of gaining a vote and the site owner does not get the benefit of the user then actually visiting the site.

    If you are going to cheat like this, why not simply clone the <form> from that page to your own site? Then you have complete control.

    Of course, if gotop100.com has any brains that won't work, because the will check to make sure the HTTP_REFERER property indeed refers to their own page. But who knows, maybe they are hackers, too, and not really careful about this kind of thing.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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