Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 07-25-2009, 06:02 PM
thumbtak's Avatar
thumbtak thumbtak is offline
Contributing Member
 
Join Date: 08-18-05
Posts: 116
iTrader: 0 / 0%
Javascript popup window and new page

I am having issues with making a button that displays a new page and then the page the button is on to go to a new page..

I got it somewhat working but it doesn't fully work. Here is the closes I got it working.

Code:
<form> <center><a href="live_popup.html"><input type=button value="Open player in popup window" onClick="javascript:popUp('/popup_player.html')"></a></center> </form>
I want popup_player.html to be displayed and the page switch to live_popup.html. Popup works find but page change doesn't always work. Does anyone know how to do this?
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 07-25-2009, 08:57 PM
Hades's Avatar
Hades Hades is offline
Senior Web Developer
 
Join Date: 01-23-07
Location: Argentina
Posts: 2,273
iTrader: 0 / 0%
Quote:
I want popup_player.html to be displayed and the page switch to live_popup.html. Popup works find but page change doesn't always work. Does anyone know how to do this?
Either the link or the button behavior are prone to fail because you are wrapping an <input> within a link <a> tag. It maybe be valid HTML but it is not a very good practice. I would suggest putting both actions on an <a> tag or on the button but don't combine them, try these:

HTML Code:
<form> <center><a href="live_popup.html" onclick="javascript:popUp('/popup_player.html');">Open player in window</a></center> </form>

HTML Code:
<form> <center><input type="button" value="Open player in popup window" onClick="javascript:popUp('/popup_player.html');window.location='live_popup.html'"></center> </form>
I'd go for the first example but both should work.

Regards,
 
Reply With Quote
  #3  
Old 07-26-2009, 12:00 AM
lordspace's Avatar
lordspace lordspace is offline
Contributing Member
 
Join Date: 05-30-06
Location: Canada
Posts: 913
iTrader: 0 / 0%
thumbtak,
another options is to use an A HREF (using target="_blank") and then when the file is loaded resize the newly opened window either by setting lower height and width or using some nice jQuery effects on onLoad action.

Code:
<a href="live_popup.html" target="_blank">Player</a>
 
Reply With Quote
  #4  
Old 07-26-2009, 06:23 AM
thumbtak's Avatar
thumbtak thumbtak is offline
Contributing Member
 
Join Date: 08-18-05
Posts: 116
iTrader: 0 / 0%
Hades thanks. I tryed out the second one and it worked out great. Now crappy internet explorer uses can use the site...lol

I don't know if this is off topic but I have another internet explorer issue if anyone can help out.

Look at the iframe at link below in k-meleon or mozilla firefox and your see text in it. Look at it in internet explorer and you will not. That is because k-meleon / mozilla firefox makes the background become what is below it. Which is what I want. iIn IE the bakground is made to be white. White is not good as the text is white.

Any Ideas?

Here is the page:
unofficialradio.com/request.html

Last edited by HTMLBasicTutor; 07-26-2009 at 11:25 PM.
 
Reply With Quote
  #5  
Old 07-26-2009, 08:11 AM
Hades's Avatar
Hades Hades is offline
Senior Web Developer
 
Join Date: 01-23-07
Location: Argentina
Posts: 2,273
iTrader: 0 / 0%
Add the allowtransparency attribute to the iframe.

HTML Code:
<iframe ... ALLOWTRANSPARENCY="true"></iframe>
 
Reply With Quote
  #6  
Old 07-26-2009, 08:19 AM
Hades's Avatar
Hades Hades is offline
Senior Web Developer
 
Join Date: 01-23-07
Location: Argentina
Posts: 2,273
iTrader: 0 / 0%
Quote:
Originally Posted by lordspace View Post
thumbtak,
another options is to use an A HREF (using target="_blank") and then when the file is loaded resize the newly opened window either by setting lower height and width or using some nice jQuery effects on onLoad action.

Code:
<a href="live_popup.html" target="_blank">Player</a>
But the _blank links open in a new tab in Firefox (and possibly in Chrome too?), and if you resize the window after opening the _blank page it will resize the whole browser with all the tabs that you have opened.

From the usability point of view I think the real solution would be not using popups at all. And open the videos in the same window, or give the user the option to open it in a different window if they choose (adding a <a href="..." target="_blank">[^]</a> next to the play option). Try to avoid popups or resizing windows because more and more browsers are disabling this feature and it will preclude your users from enjoying your content.
 
Reply With Quote
  #7  
Old 07-26-2009, 09:53 AM
lordspace's Avatar
lordspace lordspace is offline
Contributing Member
 
Join Date: 05-30-06
Location: Canada
Posts: 913
iTrader: 0 / 0%
I am a little bit concerned about opening windows with JS.
There are so many popup blockers e.g. google's toolbar.
 
Reply With Quote
  #8  
Old 07-26-2009, 12:36 PM
thumbtak's Avatar
thumbtak thumbtak is offline
Contributing Member
 
Join Date: 08-18-05
Posts: 116
iTrader: 0 / 0%
This window is not needed it is an extra so if it doesn't open then that would be okay.
 
Reply With Quote
  #9  
Old 07-26-2009, 12:41 PM
thumbtak's Avatar
thumbtak thumbtak is offline
Contributing Member
 
Join Date: 08-18-05
Posts: 116
iTrader: 0 / 0%
Quote:
Originally Posted by Hades View Post
Add the allowtransparency attribute to the iframe.

HTML Code:
<iframe ... ALLOWTRANSPARENCY="true"></iframe>
Thanks worked like a charm.
 
Reply With Quote
  #10  
Old 07-27-2009, 08:10 AM
thumbtak's Avatar
thumbtak thumbtak is offline
Contributing Member
 
Join Date: 08-18-05
Posts: 116
iTrader: 0 / 0%
Next step I forgot to say is... is there a way that when the popup is closed that the old page goes back to what it was before or the old page loads a page? Old as in page below the popup.
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Control IEFRAME or POPUP Window {urgent} zaxcoder Coding Forum 3 03-27-2009 11:05 AM
Popup new window bekdesigns Coding Forum 1 03-03-2008 01:17 AM
Title Javascript popup window thumbtak Coding Forum 16 03-09-2007 05:44 AM
Simple javascript popup window not working in FF spyderscripts Coding Forum 2 07-15-2006 07:02 PM
Help: Popup Window from Flash kontra Coding Forum 2 05-21-2004 09:43 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 10:11 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC