Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-24-2013, 08:53 PM   PM User | #1
CodingHelp
New Coder

 
Join Date: Dec 2010
Posts: 44
Thanks: 2
Thanked 0 Times in 0 Posts
CodingHelp is an unknown quantity at this point
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
CodingHelp is offline   Reply With Quote
Old 01-24-2013, 09:09 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,200
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
Old Pedant is offline   Reply With Quote
Old 01-24-2013, 09:45 PM   PM User | #3
CodingHelp
New Coder

 
Join Date: Dec 2010
Posts: 44
Thanks: 2
Thanked 0 Times in 0 Posts
CodingHelp is an unknown quantity at this point
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!
CodingHelp is offline   Reply With Quote
Old 01-24-2013, 09:57 PM   PM User | #4
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,200
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
Old Pedant is offline   Reply With Quote
Old 01-24-2013, 10:08 PM   PM User | #5
CodingHelp
New Coder

 
Join Date: Dec 2010
Posts: 44
Thanks: 2
Thanked 0 Times in 0 Posts
CodingHelp is an unknown quantity at this point
What if i were to embed the page as a widget, would ot be possible to make it dissapear if it's clicked on?
CodingHelp is offline   Reply With Quote
Old 01-24-2013, 10:21 PM   PM User | #6
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,200
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
Old Pedant is offline   Reply With Quote
Old 01-24-2013, 10:29 PM   PM User | #7
CodingHelp
New Coder

 
Join Date: Dec 2010
Posts: 44
Thanks: 2
Thanked 0 Times in 0 Posts
CodingHelp is an unknown quantity at this point
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
CodingHelp is offline   Reply With Quote
Old 01-24-2013, 11:13 PM   PM User | #8
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,200
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:48 PM.


Advertisement
Log in to turn off these ads.