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
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.
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
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.
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.