Re: Re: Some kind of Popup
| From: | Ashley Sheridan | Date: | Sat, 22 Nov 2008 18:14:26 +0000 |
| Subject: | Re: Re: Some kind of Popup | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-283680@lists.php.net to get a copy of this message | ||
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