473,383 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

pop up script!?!

Does anybody have a simple script that let's me popup a picture from a
thumbnail?

The ones i found are all very very complicated and messy in the source...

Thanks,
Tintin
Jul 20 '05 #1
11 2799
In article <JP**********************@amsnews03.chello.com>,
in**@wentinkmodelbouw.nl enlightened us with...
Does anybody have a simple script that let's me popup a picture from a
thumbnail?

The ones i found are all very very complicated and messy in the source...


Do you need it to popup in a window with specifications or just open in
a new window?
-------------------------------------------------
~kaeli~
Jesus saves, Allah protects, and Cthulhu
thinks you'd make a nice sandwich.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
Jul 20 '05 #2
"Wentink" <in**@wentinkmodelbouw.nl> wrote in message
news:JP**********************@amsnews03.chello.com ...
Does anybody have a simple script that let's me popup a picture from a
thumbnail?

The ones i found are all very very complicated and messy in the source...

Thanks,
Tintin


Try this out (NOTE - you should probably store the javascript in a *.js file
so you can reuse it). I tested this on IE6 and Mozilla 1.4.

All you need to do is pass the src to the image to the imagePopup()
function. Then you just need to call that function either in an <a> tag or
using an onclick handler in a button or image or whatever you want. The
script will dynamically determine the height and width of the image so you
don't even need to include those (i find that makes setting the scripting up
a lot easier in a page!).
<html>
<head>
<title>Popup Image Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
// Variable to store a reference to the popup window
var popupWindow

/*
Function: imagePopup()

Description:

Function to open an image in a popup window

Function Parameters:

ImageSource - REQUIRED - the src of the image to open in the popup window

ImageWidth - OPTIONAL - the width of the image

ImageHeight - OPTIONAL - the height of the image

ImageTitle - OPTIONAL - the title for the image - used in the <title>
attribute in the popup window

PopupTitle - OPTIONAL - the window.name property for the popup window

*/
function imagePopup( ImageSource, ImageWidth, ImageHeight, ImageTitle,
PopupTitle ) {

/*
1. PROCESS THE PASSED FUNCTION VALUES
*/

// Set default values if none were passed
PopupTitle = ( PopupTitle == '' ) ? 'imgPopup' : PopupTitle; // Note - this
must not contain any spaces
ImageTitle = ( ImageTitle == '' ) ? ImageSource : ImageTitle; // Use the
image src as the default title if none was passed

// See if we need to dynamically grab the Image width dimensions if none
were passed in the function
if ( ImageWidth == '' || typeof( ImageWidth ) == "undefined" ) {
// If no image width was passed - preload the image then grab the width
value from the preloaded image
theImage = new Image();
theImage.src = ImageSource;
ImageWidth = theImage.width;
}
// See if we need to dynamically grab the Image width dimensions if none
were passed in the function
if ( ImageHeight == '' || typeof( ImageHeight ) == "undefined" ) {
ImageHeight = theImage.height;
}
/*
2. CALCULATE CENTERING VALUES FOR THE POPUP WINDOW
*/

// I think this works in NS6+ & Mozilla )!
if (document.all) {
var xMax = screen.width;
var yMax = screen.height;
}
else {
if (document.layers) {
var xMax = window.outerWidth;
var yMax = window.outerHeight;
}
else {
var xMax = 640;
var yMax = 480;
}
}
xOffset = (xMax - ImageWidth) / 2;
yOffset = (yMax - ImageHeight) / 2;
/*
3. SETUP POPUP WINDOW VALUES
*/

/* Set the various features for the preview window - width, height,
titlebar etc. */
var popupFeatures =
'width=' + ImageWidth +
',height=' + ImageHeight +
',screenX=' + xOffset +
',screenY=' + yOffset +
',top=' + yOffset +
',left=' + xOffset
/*
4. CREATE AND OPEN THE POPUP WINDOW
*/

popupWindow = window.open('', PopupTitle,popupFeatures);
// Set the window opener
if ( popupWindow.opener == null ) {
popupWindow.opener = self;
}
popupWindow.focus();
/*
5. WRITE THE ACTUAL IMAGE TO THE POPUP WINDOW
*/

// Create the default HTML content for the popup window
var popupContent = ""
popupContent += "\n<html><head><title>" + ImageTitle + "</title><meta
http-equiv='Content-Type' content='text/html; charset=iso-8859-1'></head>"
popupContent += "\n<body style='margin: 0px; padding: 0px;'>" // Need to
make sure the <body> has no padding or margin or the image will be
off-kilter
popupContent += "\n<div align='center'>"
popupContent += "<img id='popupimage'>" // This is the <img> that we
replace the src, width & height (see below)
popupContent += "</div>"
popupContent += "\n</body>"
popupContent += "\n</html>"
popupWindow.document.write( popupContent )
popupWindow.document.close()

// Now write the data for the image (src, width & height)
oPopupImg = popupWindow.document.getElementById('popupimage'); // Create
an object reference to the <img> in the popup window
oPopupImg.src = ImageSource; // Replace the source
oPopupImg.width = ImageWidth;
oPopupImg.height = ImageHeight;

}
</script>
</head>

<body>
<h1>Image Popup Test</h1>
<input type="button" name="view" value="view" onclick="imagePopup(
'http://www.mystudios.com/art/impress/monet/monet-wheat-field-1881.jpg' )"/>
</body>
</html>
Jul 20 '05 #3
Slight modification - I forgot to preload the image in the case where no
ImageHeight was passed - I was relying on the fact that no ImageWidth would
be passed as well (which is probably true in 99% of the cases - but just to
be sure)

THE CHANGES:

Find this:
// See if we need to dynamically grab the Image width dimensions if none
were passed in the function
if ( ImageHeight == '' || typeof( ImageHeight ) == "undefined" ) {
ImageHeight = theImage.height;
}
And replace it with:

// See if we need to dynamically grab the Image height dimensions if none
were passed in the function
if ( ImageHeight == '' || typeof( ImageHeight ) == "undefined" ) {
theImage = new Image();
theImage.src = ImageSource;
ImageHeight = theImage.height;
}

"DB McGee" <no*****@noreply.com> wrote in message
news:DE****************@news01.bloor.is.net.cable. rogers.com...
"Wentink" <in**@wentinkmodelbouw.nl> wrote in message
news:JP**********************@amsnews03.chello.com ...
Does anybody have a simple script that let's me popup a picture from a
thumbnail?

The ones i found are all very very complicated and messy in the source...
Thanks,
Tintin


Try this out (NOTE - you should probably store the javascript in a *.js

file so you can reuse it). I tested this on IE6 and Mozilla 1.4.

All you need to do is pass the src to the image to the imagePopup()
function. Then you just need to call that function either in an <a> tag or using an onclick handler in a button or image or whatever you want. The
script will dynamically determine the height and width of the image so you
don't even need to include those (i find that makes setting the scripting up a lot easier in a page!).
<html>
<head>
<title>Popup Image Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
// Variable to store a reference to the popup window
var popupWindow

/*
Function: imagePopup()

Description:

Function to open an image in a popup window

Function Parameters:

ImageSource - REQUIRED - the src of the image to open in the popup window
ImageWidth - OPTIONAL - the width of the image

ImageHeight - OPTIONAL - the height of the image

ImageTitle - OPTIONAL - the title for the image - used in the <title>
attribute in the popup window

PopupTitle - OPTIONAL - the window.name property for the popup window

*/
function imagePopup( ImageSource, ImageWidth, ImageHeight, ImageTitle,
PopupTitle ) {

/*
1. PROCESS THE PASSED FUNCTION VALUES
*/

// Set default values if none were passed
PopupTitle = ( PopupTitle == '' ) ? 'imgPopup' : PopupTitle; // Note - this must not contain any spaces
ImageTitle = ( ImageTitle == '' ) ? ImageSource : ImageTitle; // Use the
image src as the default title if none was passed

// See if we need to dynamically grab the Image width dimensions if none
were passed in the function
if ( ImageWidth == '' || typeof( ImageWidth ) == "undefined" ) {
// If no image width was passed - preload the image then grab the width
value from the preloaded image
theImage = new Image();
theImage.src = ImageSource;
ImageWidth = theImage.width;
}
// See if we need to dynamically grab the Image width dimensions if none
were passed in the function
if ( ImageHeight == '' || typeof( ImageHeight ) == "undefined" ) {
ImageHeight = theImage.height;
}
/*
2. CALCULATE CENTERING VALUES FOR THE POPUP WINDOW
*/

// I think this works in NS6+ & Mozilla )!
if (document.all) {
var xMax = screen.width;
var yMax = screen.height;
}
else {
if (document.layers) {
var xMax = window.outerWidth;
var yMax = window.outerHeight;
}
else {
var xMax = 640;
var yMax = 480;
}
}
xOffset = (xMax - ImageWidth) / 2;
yOffset = (yMax - ImageHeight) / 2;
/*
3. SETUP POPUP WINDOW VALUES
*/

/* Set the various features for the preview window - width, height,
titlebar etc. */
var popupFeatures =
'width=' + ImageWidth +
',height=' + ImageHeight +
',screenX=' + xOffset +
',screenY=' + yOffset +
',top=' + yOffset +
',left=' + xOffset
/*
4. CREATE AND OPEN THE POPUP WINDOW
*/

popupWindow = window.open('', PopupTitle,popupFeatures);
// Set the window opener
if ( popupWindow.opener == null ) {
popupWindow.opener = self;
}
popupWindow.focus();
/*
5. WRITE THE ACTUAL IMAGE TO THE POPUP WINDOW
*/

// Create the default HTML content for the popup window
var popupContent = ""
popupContent += "\n<html><head><title>" + ImageTitle + "</title><meta
http-equiv='Content-Type' content='text/html; charset=iso-8859-1'></head>"
popupContent += "\n<body style='margin: 0px; padding: 0px;'>" // Need to
make sure the <body> has no padding or margin or the image will be
off-kilter
popupContent += "\n<div align='center'>"
popupContent += "<img id='popupimage'>" // This is the <img> that we
replace the src, width & height (see below)
popupContent += "</div>"
popupContent += "\n</body>"
popupContent += "\n</html>"
popupWindow.document.write( popupContent )
popupWindow.document.close()

// Now write the data for the image (src, width & height)
oPopupImg = popupWindow.document.getElementById('popupimage'); // Create
an object reference to the <img> in the popup window
oPopupImg.src = ImageSource; // Replace the source
oPopupImg.width = ImageWidth;
oPopupImg.height = ImageHeight;

}
</script>
</head>

<body>
<h1>Image Popup Test</h1>
<input type="button" name="view" value="view" onclick="imagePopup(
'http://www.mystudios.com/art/impress/monet/monet-wheat-field-1881.jpg' )"/> </body>
</html>

Jul 20 '05 #4
"DB McGee" <no*****@noreply.com> wrote in message
news:DE****************@news01.bloor.is.net.cable. rogers.com...
<snip>
Try this out (NOTE - you should probably store the javascript in a
*.js file so you can reuse it). I tested this on IE6 and Mozilla 1.4. <snip> // See if we need to dynamically grab the Image width dimensions
// if none were passed in the function
if ( ImageWidth == '' || typeof( ImageWidth ) == "undefined" ) {
// If no image width was passed - preload the image then grab
// the width value from the preloaded image
theImage = new Image();
theImage.src = ImageSource;
ImageWidth = theImage.width;
}
That is a very optimistic piece of code. Assuming that the Image
constructor is not a non-functional dummy (as on ICEbrowser 5), setting
the src will cause an asynchronous request to a server for the specified
file (assuming that it is not in the browser cache already). That will
take some time even on a fast connection, yet milliseconds (if that)
later you are reading the width value from the image object. Not all
Image object implementations transfer the dimensions of the image to the
width and height properties anyway but those that do will no know the
size of the image until the server at least starts to return it (it
would need at least the first 10 bytes for a GIF file to know the image
size).

There are no truly cross-browser method of automatically determining the
size of an image from its file. Some of the download timing problems can
be avoided by using the Image.onload/abort/error events to attempt to
read the image size after it has arrived, but that still assumes that
the Image implementation will read that information from the file and
make it available on the Image object (and that the events will be
triggered properly).

Probably the only truly reliable approach would be to have the script
directly passed the required dimensions for the image.

<snip> // I think this works in NS6+ & Mozilla )!
It says above that you tested on Mozilla so you should know that NA6+
and Mozilla will be using the default 640x480 values.
if (document.all) {
var xMax = screen.width;
var yMax = screen.height;
}
else {
if (document.layers) {
var xMax = window.outerWidth;
var yMax = window.outerHeight;
}
else {
var xMax = 640;
var yMax = 480;
}
}
That block uses crazy logic, there is no relationship between a browser
having a document.all collection and a window.screen object, and there
is no relationship between the document.layers collection and
window.outerWindth/Height. There is, however, a direct relationship
between the existence of window.screen in a browser and the existence of
window.screen. Similarly, knowing that - typeof outerWidth == 'number' -
would be a reasonable indicator that outerWidth/Height values where
available on the browser (though there are a number of browsers that
erroneously report the same values for outerWidth/Height as the
(apparently) correct values that they use for innerHeigh/Width).

So a decision logic that goes:-

if(typeof screen != 'undefined'){
// read screen object properties.
}else if(typeof outerWidth == 'number){
// use outerWidth and assume outerHeight for symmetry (or
explicitly test it).
}else{
//default action
}

-would seem to exactly match the requirement of the preceding code while
requiring no unsupported inferences about the browser DOM.

But the actions of this code are also questionable. The screen width and
height properties should almost never be preferred over the
availWidth/Height values as they (sometimes) take into account various
taskbars (the number, size and distribution of which cannot be assumed).
outerWidth/Heigh will only be related to the screen dimensions if the
browser window is maximised, which will almost never be the case on a
monitor bigger than 19 inches. And the defaults are bigger than the
entire screen size of most PDAs.

Generally, trying to explicitly position a browser window is fraught
with problems. On Opera's MDI interface there is every possibility that
positioning a window based on the screen dimensions will place the
window out of site. On multi-monitor displays some set-ups will have the
new window positioned across screen boundaries (the one place that you
don't want it), while other may have the new window appearing on a
different monitor to the original browser window. Usually opening a new
window without explicit positioning will allow the browser to put the
new window in a position that it thinks makes sense, usually over the
existing window but slightly offset towards its centre. Which means that
the new window is going to be appearing in a position that reliably
allows the user to be aware of it.

<snip> /* Set the various features for the preview window -
width, height, titlebar etc. */
var popupFeatures =
'width=' + ImageWidth +
',height=' + ImageHeight +
',screenX=' + xOffset +
',screenY=' + yOffset +
',top=' + yOffset +
',left=' + xOffset
Assuming that at this point the ImageWidth and ImageHeigth variables do
hold the dimensions of the image, you are making no allowance for window
chrome. That is not surprising as it is extremely difficult to determine
the size and distribution of window chrome, and assuming standard values
cannot be valid across OSs and are almost always alterable under user
preferences anyway.

However, I observe that you are not providing specification for
resizable or scrollbars, causing then to default to off. Removing these
features places the onus on the script to ensure that the new window
will be able to display all of its contents under _all_ circumstances
because if the script gets this detail wrong there will be nothing that
the user can do to access the content. As it stands this script does not
even come close to achieving that level of reliability in its sizing
decisions. But then I have never seen a script that does cover all of
the possibilities (which leads me to suspect that it is just not
possible to do so), which means that leaving the new window at least
sizable and probably scrollable is probably the best approach towards
addressing the issues of window pre-sizing.
/*
4. CREATE AND OPEN THE POPUP WINDOW
*/

popupWindow = window.open('', PopupTitle,popupFeatures);
As some browsers just do not have a window.open method this code will
predictably error and terminate at this point in some environments,
preventing any controlled degradation/fall-back. In the absence of a
window.open function a reasonable fall-back option would be to navigate
the current browser window to show the image that it intended to be
shown in the pop-up. To do that you would need to test for the presence
of the window.open function and branch the code if it is not present.
Unfortunately, Pocket IE errors if you attempt to test for the
window.open function but as it does not implement window.open it was
going to error if you called it untested, and at least you gain the
fall-back option on other non-window.open browsers.
// Set the window opener
if ( popupWindow.opener == null ) {
popupWindow.opener = self;
}
popupWindow.focus();
The main problem faced (and almost always ignored) by any script that
attempts to open a new window is the existence of pop-up blocking
software and browser that restrict the use of pop-ups. If it was
possible to determine at this point that the call to window.open had not
resulted in an actual new window, or that that window was about to be
closed by an external pop-up blocker, then the script could take the
fall-back option of navigating the current window (instead of just
giving the user the impression that the link/button was just broken).

Unfortunately, pop-up blockers use such a range of divers approaches
that it is probably impossible to cover all of the possibilities. Which
probably explains why knowledgeable script authors who want to achieve
this type of pop-up display of images reliably (or at least in a way
that allows the script to know when and where it will fail and take some
fall-back action) are more likely to use a DHTML based in-window pop-up.

<snip>popupContent += "\n<body style='margin: 0px; padding: 0px;'>"
// Need to make sure the <body> has no padding
or margin or the image will be off-kilter

<snip>

Opera browsers pace default padding on the HTML element rather than on
the BODY.

Richard.
Jul 20 '05 #5
Cool - lets see your solution!

"Richard Cornford" <Ri*****@litotes.demon.co.uk> wrote in message
news:bn*******************@news.demon.co.uk...
"DB McGee" <no*****@noreply.com> wrote in message
news:DE****************@news01.bloor.is.net.cable. rogers.com...
<snip>
Try this out (NOTE - you should probably store the javascript in a
*.js file so you can reuse it). I tested this on IE6 and Mozilla 1.4.

<snip>
// See if we need to dynamically grab the Image width dimensions
// if none were passed in the function
if ( ImageWidth == '' || typeof( ImageWidth ) == "undefined" ) {
// If no image width was passed - preload the image then grab
// the width value from the preloaded image
theImage = new Image();
theImage.src = ImageSource;
ImageWidth = theImage.width;
}


That is a very optimistic piece of code. Assuming that the Image
constructor is not a non-functional dummy (as on ICEbrowser 5), setting
the src will cause an asynchronous request to a server for the specified
file (assuming that it is not in the browser cache already). That will
take some time even on a fast connection, yet milliseconds (if that)
later you are reading the width value from the image object. Not all
Image object implementations transfer the dimensions of the image to the
width and height properties anyway but those that do will no know the
size of the image until the server at least starts to return it (it
would need at least the first 10 bytes for a GIF file to know the image
size).

There are no truly cross-browser method of automatically determining the
size of an image from its file. Some of the download timing problems can
be avoided by using the Image.onload/abort/error events to attempt to
read the image size after it has arrived, but that still assumes that
the Image implementation will read that information from the file and
make it available on the Image object (and that the events will be
triggered properly).

Probably the only truly reliable approach would be to have the script
directly passed the required dimensions for the image.

<snip>
// I think this works in NS6+ & Mozilla )!


It says above that you tested on Mozilla so you should know that NA6+
and Mozilla will be using the default 640x480 values.
if (document.all) {
var xMax = screen.width;
var yMax = screen.height;
}
else {
if (document.layers) {
var xMax = window.outerWidth;
var yMax = window.outerHeight;
}
else {
var xMax = 640;
var yMax = 480;
}
}


That block uses crazy logic, there is no relationship between a browser
having a document.all collection and a window.screen object, and there
is no relationship between the document.layers collection and
window.outerWindth/Height. There is, however, a direct relationship
between the existence of window.screen in a browser and the existence of
window.screen. Similarly, knowing that - typeof outerWidth == 'number' -
would be a reasonable indicator that outerWidth/Height values where
available on the browser (though there are a number of browsers that
erroneously report the same values for outerWidth/Height as the
(apparently) correct values that they use for innerHeigh/Width).

So a decision logic that goes:-

if(typeof screen != 'undefined'){
// read screen object properties.
}else if(typeof outerWidth == 'number){
// use outerWidth and assume outerHeight for symmetry (or
explicitly test it).
}else{
//default action
}

-would seem to exactly match the requirement of the preceding code while
requiring no unsupported inferences about the browser DOM.

But the actions of this code are also questionable. The screen width and
height properties should almost never be preferred over the
availWidth/Height values as they (sometimes) take into account various
taskbars (the number, size and distribution of which cannot be assumed).
outerWidth/Heigh will only be related to the screen dimensions if the
browser window is maximised, which will almost never be the case on a
monitor bigger than 19 inches. And the defaults are bigger than the
entire screen size of most PDAs.

Generally, trying to explicitly position a browser window is fraught
with problems. On Opera's MDI interface there is every possibility that
positioning a window based on the screen dimensions will place the
window out of site. On multi-monitor displays some set-ups will have the
new window positioned across screen boundaries (the one place that you
don't want it), while other may have the new window appearing on a
different monitor to the original browser window. Usually opening a new
window without explicit positioning will allow the browser to put the
new window in a position that it thinks makes sense, usually over the
existing window but slightly offset towards its centre. Which means that
the new window is going to be appearing in a position that reliably
allows the user to be aware of it.

<snip>
/* Set the various features for the preview window -
width, height, titlebar etc. */
var popupFeatures =
'width=' + ImageWidth +
',height=' + ImageHeight +
',screenX=' + xOffset +
',screenY=' + yOffset +
',top=' + yOffset +
',left=' + xOffset


Assuming that at this point the ImageWidth and ImageHeigth variables do
hold the dimensions of the image, you are making no allowance for window
chrome. That is not surprising as it is extremely difficult to determine
the size and distribution of window chrome, and assuming standard values
cannot be valid across OSs and are almost always alterable under user
preferences anyway.

However, I observe that you are not providing specification for
resizable or scrollbars, causing then to default to off. Removing these
features places the onus on the script to ensure that the new window
will be able to display all of its contents under _all_ circumstances
because if the script gets this detail wrong there will be nothing that
the user can do to access the content. As it stands this script does not
even come close to achieving that level of reliability in its sizing
decisions. But then I have never seen a script that does cover all of
the possibilities (which leads me to suspect that it is just not
possible to do so), which means that leaving the new window at least
sizable and probably scrollable is probably the best approach towards
addressing the issues of window pre-sizing.
/*
4. CREATE AND OPEN THE POPUP WINDOW
*/

popupWindow = window.open('', PopupTitle,popupFeatures);


As some browsers just do not have a window.open method this code will
predictably error and terminate at this point in some environments,
preventing any controlled degradation/fall-back. In the absence of a
window.open function a reasonable fall-back option would be to navigate
the current browser window to show the image that it intended to be
shown in the pop-up. To do that you would need to test for the presence
of the window.open function and branch the code if it is not present.
Unfortunately, Pocket IE errors if you attempt to test for the
window.open function but as it does not implement window.open it was
going to error if you called it untested, and at least you gain the
fall-back option on other non-window.open browsers.
// Set the window opener
if ( popupWindow.opener == null ) {
popupWindow.opener = self;
}
popupWindow.focus();


The main problem faced (and almost always ignored) by any script that
attempts to open a new window is the existence of pop-up blocking
software and browser that restrict the use of pop-ups. If it was
possible to determine at this point that the call to window.open had not
resulted in an actual new window, or that that window was about to be
closed by an external pop-up blocker, then the script could take the
fall-back option of navigating the current window (instead of just
giving the user the impression that the link/button was just broken).

Unfortunately, pop-up blockers use such a range of divers approaches
that it is probably impossible to cover all of the possibilities. Which
probably explains why knowledgeable script authors who want to achieve
this type of pop-up display of images reliably (or at least in a way
that allows the script to know when and where it will fail and take some
fall-back action) are more likely to use a DHTML based in-window pop-up.

<snip>
popupContent += "\n<body style='margin: 0px; padding: 0px;'>"
// Need to make sure the <body> has no padding
or margin or the image will be off-kilter

<snip>

Opera browsers pace default padding on the HTML element rather than on
the BODY.

Richard.

Jul 20 '05 #6
DB McGee wrote:
Cool - lets see your solution!
Let's see your brain. I doubt there is one:
[213 lines of fullquote]

PointedEars

Jul 20 '05 #7
"DB McGee" <no*****@noreply.com> wrote in message
news:rm*********************@news04.bloor.is.net.c able.rogers.com...
Cool - lets see your solution!


Given that I said:-

<snip>
... leads me to suspect that it is just not possible to do so ...
- and:-

<snip>... probably impossible to cover all of the possibilities. ...
- I assume you are not referring to my solution to a generalised script
for displaying images in pop-up windows, but instead are referring to:-

<snip>... use a DHTML based in-window pop-up.

<snip>

I must say I admire the speed and efficiency of your archive searching
techniques. While I know that I have posted (more or less) detail on
every aspect of creating an image displaying in-window pop-up at some
time, I could not remember if I had ever posted a complete example, and
the prospect of searching the groups.google.com archives to determine
that one way or the other is somewhat daunting. Still, you have saved me
the effort of checking. But even if I had the result would not have been
much use to the OP as any example I had created would have been fairly
tightly integrated with the HTML DOM it was scripting in order to
achiever reliable fall-back (particularly in the face of JavaScript
non-availability). I don't believe this is an area that lends itself to
generalised cut-n-paste solutions.

There are people (including myself) who's reaction to having issues with
their scripts pointed out to them is to take those points as indicating
aspects of a script that need improving, possibly even responding by
posting a better version with the issues addressed. If I had not adopted
that attitude myself I would be no better at browser scripting now than
I was 18 months ago, and, although 18 months ago I believed that I was
good at JavaScript authoring, in retrospect I can see that I was utterly
mistaken in that opinion.

If you did respond to the points that I raised with an improved
generalised pop-up window script that addressed the issues (particularly
the unpredictable unreliability that is introduced by pop-up blocking
software) then the result would be a major contribution to the browser
scripting world. It would allow the people who insist on using pop-ups
regardless of the reliability to pull their heads out of the sand and
get on with addressing the remaining accessibility (and desirability)
issues.

It was attempting to address those pop-up reliability issues that
convinced me that there was no adequate strategy that could be applied
to the problem and convinced me that it was better to look in other
directions for that type of functionality. But I could still be wrong,
and if so I would love to see the code that did it.

Richard.
Jul 20 '05 #8
Was the insult really needed? Must've read this before your morning cup of
coffee?

Obviously, my solution was lacking and there are people clearly more able
and skilled than I in this newsgroup. I just figured that if someone can
take the time to deconstruct a response, they should at least try to provide
a solution to the question asked.

For someone of Mr. Cornford obvious talents, this should be a fairly trivial
task. I'm anxious to see a solution that covers the various issues raised
by Mr. Cornford in his response to my solution. I'm sure others would as
well. That would be far more illuminating to the archival record of the
original message in this thread than simply slinging insults around.
"Thomas 'PointedEars' Lahn" <Po*********@web.de> wrote in message
news:3F**************@PointedEars.de...
DB McGee wrote:
Cool - lets see your solution!


Let's see your brain. I doubt there is one:
[213 lines of fullquote]

PointedEars

Jul 20 '05 #9
DB McGee wrote:
Was the insult really needed? [...]
[nuked appended fullquote]

^^^^^^^^^^^^^^^^^^
[_] You understood.

BTW: If you would have provided an e-mail address as RFC 1036 and 2822
specify, I would have replied in private, not in the public newsgroup.
PointedEars

Jul 20 '05 #10
JRS: In article <kQ*******************@news01.bloor.is.net.cable.r ogers
..com>, seen in news:comp.lang.javascript, DB McGee <no*****@noreply.com>
posted at Thu, 23 Oct 2003 22:43:28 :-
Was the insult really needed?


Since you re-posted over 200 lines of material to add a single line :
Yes, indeed it was.

Before writing to a newsgroup, you should seek and read its FAQ. That
is a useful precaution against giving the appearance of thoughtlessness
or ignorance. Most FAQs, including ours, cite and/or describe the
proper construction of news articles, including replies.

But, PE, such remonstrations should always be accompanied by a link to
educational material.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.
Jul 20 '05 #11
"Richard Cornford" <Ri*****@litotes.demon.co.uk> wrote in message
news:bn*******************@news.demon.co.uk...
Cool - lets see your solution! <snip>
... , but instead are referring to:-

<snip>... use a DHTML based in-window pop-up.
<snip>..., I could not remember if I had ever posted a complete example, ...

<snip>

There is not much point posting the code of an example without the
images, so I have put an example on-line:-

<URL:
http://www.litotes.demon.co.uk/examp...ndowPopUp.html >

- (it may not be there for more than a week or so.)

Richard.
Jul 20 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Mike Daniel | last post by:
I am attempting to use document.write(pageVar) that displays a new html page within a pop-up window and the popup is failing. Also note that pageVar is a complete HTML page containing other java...
1
by: bayouprophet | last post by:
Cant get menu script to to put linked page in the same frame. I am new to Java and I am wondering what am I doing wrong? below are my java applet file, frame.html file, and my text file and one...
1
by: Allen | last post by:
I am trying to add an additional photo/hyperlink to the company web site (I didn't create it) without any luck. The mouseover feature 'highlights' pics by swapping them with another pic using this...
3
by: Water Cooler v2 | last post by:
Questions: 1. Can there be more than a single script block in a given HEAD tag? 2. Can there be more than a single script block in a given BODY tag? To test, I tried the following code. None...
2
by: bilaribilari | last post by:
Hi all, I am using Tidy (C) for parsing html pages. I encountered a page that has some script as follows: <script> .... var abc = "<script>some stuff here</" + "script>"; .... </script>
19
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function myFunc(val1ok, val2ok) ' do something ok myFunc = " return something ok" End Function </script>
3
by: rsteph | last post by:
I have a script that shows the time and date. It's been working on my site for quite a while now. Suddenly it stops showing up, after getting my drop down menu to work. If I put text between the...
3
by: Angus | last post by:
I have a web page with a toolbar containing a Save button. The Save button can change contextually to be a Search button in some cases. Hence the button name searchsavechanges. The snippet of...
7
by: imtmub | last post by:
I have a page, Head tag Contains many Scripts and style sheet for Menu and Page. This code working fine and displaying menus and page as i wanted. Check this page for reference....
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.