Re: [PHP] Re: Some kind of Popup

2009-02-07 Thread Patrick Moloney

Ashley Sheridan wrote:

On Sat, 2008-11-22 at 12:32 -0500, Patrick Moloney wrote:

Yeti wrote:

Another JavaScript method would be to load the content in a hidden div
with position: absolute.
I think that's what I was considering doing with CSS except it would be 
labels only in the content. I only wanted to retrieve the data record 
from mysql if the user asked for the specs.


One issue is I don't want to leave the space available on my regular web 
page and would like to try not to overwrite something there - I'd rather 
have a separate window of some sort that sort of floats over the web page.



The best way to have the popup work, even with popup blockers is to have
a link like this:

a href=details.php?id=1 target=details onclick=window.open('about:
blank', 'details','width=300,height=200');More Details/a

The onclick handler is called before the link is actioned, and it opens
a new window with your settings, called 'details'. When that is
finished, the browser continues actioning the link, looks to find the
window/frame called 'details', finds one, and uses it. This way, even if
a user has scripting turned off, the link still works and opens in a new
window.


Ash
www.ashleysheridan.co.uk



Ashley,
Thanks, I finally worked on the popup you suggested. That is the closest 
to what I am looking for. I'm sure there are some other settings that 
could be useful. For example, the popup window gets hidden behind the 
primary web page if the user goes back there, and does not come back if 
he clicks again.


But, my bigger question is this: Is this solution specific to MS 
Windows. What would happen if someone were viewing the website using 
Apple or Linus etc?


Here's hoping you see this.

Thanks,
Patrick

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Some kind of Popup

2009-02-07 Thread Ashley Sheridan
On Sat, 2009-02-07 at 09:06 -0500, Patrick Moloney wrote:
 Ashley Sheridan wrote:
  On Sat, 2008-11-22 at 12:32 -0500, Patrick Moloney wrote:
  Yeti wrote:
  Another JavaScript method would be to load the content in a hidden div
  with position: absolute.
  I think that's what I was considering doing with CSS except it would be 
  labels only in the content. I only wanted to retrieve the data record 
  from mysql if the user asked for the specs.
 
  One issue is I don't want to leave the space available on my regular web 
  page and would like to try not to overwrite something there - I'd rather 
  have a separate window of some sort that sort of floats over the web page.
 
  The best way to have the popup work, even with popup blockers is to have
  a link like this:
  
  a href=details.php?id=1 target=details onclick=window.open('about:
  blank', 'details','width=300,height=200');More Details/a
  
  The onclick handler is called before the link is actioned, and it opens
  a new window with your settings, called 'details'. When that is
  finished, the browser continues actioning the link, looks to find the
  window/frame called 'details', finds one, and uses it. This way, even if
  a user has scripting turned off, the link still works and opens in a new
  window.
  
  
  Ash
  www.ashleysheridan.co.uk
  
 
 Ashley,
 Thanks, I finally worked on the popup you suggested. That is the closest 
 to what I am looking for. I'm sure there are some other settings that 
 could be useful. For example, the popup window gets hidden behind the 
 primary web page if the user goes back there, and does not come back if 
 he clicks again.
 
 But, my bigger question is this: Is this solution specific to MS 
 Windows. What would happen if someone were viewing the website using 
 Apple or Linus etc?
 
 Here's hoping you see this.
 
 Thanks,
 Patrick
 
I use Linux myself, and the Window does stay in the background if it's
already open. You could fix this by changing the onclick a bit:

script language=javascript type=text/javascript
function details_popup()
{
detailsWin = window.open('about: blank',
'details','width=300,height=200');
detailsWin.focus();
}
/script



a href=details.php?id=1 target=details
onclick=details_popup()More Details/a

I've not tested this, but it should allow your link to bring the window
to focus even if it is already open and in the background.


Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Some kind of Popup

2009-02-07 Thread Phpster
No, it's a generic solution, should be pretty much the same across  
browsers. Why not download more browsers and test?


I would also add a window.focus() to the body tag in the popup to  
bring the window back on top when the user reclocks the link


body onload='window.focus();'

Bastien

Sent from my iPod

On Feb 7, 2009, at 9:06, Patrick Moloney webpa...@gmail.com wrote:


Ashley Sheridan wrote:

On Sat, 2008-11-22 at 12:32 -0500, Patrick Moloney wrote:

Yeti wrote:
Another JavaScript method would be to load the content in a  
hidden div

with position: absolute.
I think that's what I was considering doing with CSS except it  
would be labels only in the content. I only wanted to retrieve the  
data record from mysql if the user asked for the specs.


One issue is I don't want to leave the space available on my  
regular web page and would like to try not to overwrite something  
there - I'd rather have a separate window of some sort that sort  
of floats over the web page.


The best way to have the popup work, even with popup blockers is to  
have

a link like this:
a href=details.php?id=1 target=details  
onclick=window.open('about:

blank', 'details','width=300,height=200');More Details/a
The onclick handler is called before the link is actioned, and it  
opens

a new window with your settings, called 'details'. When that is
finished, the browser continues actioning the link, looks to find the
window/frame called 'details', finds one, and uses it. This way,  
even if
a user has scripting turned off, the link still works and opens in  
a new

window.
Ash
www.ashleysheridan.co.uk


Ashley,
Thanks, I finally worked on the popup you suggested. That is the  
closest to what I am looking for. I'm sure there are some other  
settings that could be useful. For example, the popup window gets  
hidden behind the primary web page if the user goes back there, and  
does not come back if he clicks again.


But, my bigger question is this: Is this solution specific to MS  
Windows. What would happen if someone were viewing the website using  
Apple or Linus etc?


Here's hoping you see this.

Thanks,
Patrick

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Some kind of Popup

2009-02-07 Thread Patrick Moloney

Phpster wrote:
No, it's a generic solution, should be pretty much the same across 
browsers. Why not download more browsers and test?




Thanks all, I thought this might get lost in history here.
It's not just different browsers, it's different operating systems - 
Apple, Linux, more. I can't download those. Although I have thought 
about setting up one dedicated machine just to test Linux on such things.


I thought the Window function(?) is probably part of MS Windows. Maybe 
it's also implemented in Linux, possibly others just to be compatible.

I'll keep working on this with a little CSS and other options.
Thanks

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Some kind of Popup

2009-02-07 Thread Ashley Sheridan
On Sat, 2009-02-07 at 09:43 -0500, Patrick Moloney wrote:
 Phpster wrote:
  No, it's a generic solution, should be pretty much the same across 
  browsers. Why not download more browsers and test?
  
 
 Thanks all, I thought this might get lost in history here.
 It's not just different browsers, it's different operating systems - 
 Apple, Linux, more. I can't download those. Although I have thought 
 about setting up one dedicated machine just to test Linux on such things.
 
 I thought the Window function(?) is probably part of MS Windows. Maybe 
 it's also implemented in Linux, possibly others just to be compatible.
 I'll keep working on this with a little CSS and other options.
 Thanks
 
Window doesn't refer to MS Windows, it's just the generic object for the
browser window, so anything that supports Javascript will support it!
There are a lot of browser-specific additions to Javascript, but the
code we've all shown here is all pretty generic.


Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Some kind of Popup

2008-11-22 Thread Yeti
Another JavaScript method would be to load the content in a hidden div
with position: absolute.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Some kind of Popup

2008-11-22 Thread Patrick Moloney

Yeti wrote:

Another JavaScript method would be to load the content in a hidden div
with position: absolute.


I think that's what I was considering doing with CSS except it would be 
labels only in the content. I only wanted to retrieve the data record 
from mysql if the user asked for the specs.


One issue is I don't want to leave the space available on my regular web 
page and would like to try not to overwrite something there - I'd rather 
have a separate window of some sort that sort of floats over the web page.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Some kind of Popup

2008-11-22 Thread Ashley Sheridan
On Sat, 2008-11-22 at 12:32 -0500, Patrick Moloney wrote:
 Yeti wrote:
  Another JavaScript method would be to load the content in a hidden div
  with position: absolute.
 
 I think that's what I was considering doing with CSS except it would be 
 labels only in the content. I only wanted to retrieve the data record 
 from mysql if the user asked for the specs.
 
 One issue is I don't want to leave the space available on my regular web 
 page and would like to try not to overwrite something there - I'd rather 
 have a separate window of some sort that sort of floats over the web page.
 
The best way to have the popup work, even with popup blockers is to have
a link like this:

a href=details.php?id=1 target=details onclick=window.open('about:
blank', 'details','width=300,height=200');More Details/a

The onclick handler is called before the link is actioned, and it opens
a new window with your settings, called 'details'. When that is
finished, the browser continues actioning the link, looks to find the
window/frame called 'details', finds one, and uses it. This way, even if
a user has scripting turned off, the link still works and opens in a new
window.


Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Some kind of Popup

2008-11-22 Thread Yeti
 One issue is I don't want to leave the space available on my regular web
 page and would like to try not to overwrite something there - I'd rather
 have a separate window of some sort that sort of floats over the web page.

Well, since Javascript does the Job anyways you don't have to load it
with the page when doing the div method.
You would only need this little addition to your css ..

style type=text/css
.div_win {
position: absolute;
width: 400px;
top: 100px;
left: 10%;
visibility: hidden;
}
/style

When user initializes the request by clicking a link

script type='text/javascript'
var div_window = document.createElement('div');
div_window.setAttribute('class', 'div_win');
div_window.className = 'div_win';
document.body.appendChild(div_window);
/script

Then you do some AJAX or JSON or whatever and apply it to the div.
You can also move the div around doing it somehow like this ...
http://www.quirksmode.org/js/dragdrop.html

Still, opening up a new window might be the simple solution after all lol.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php