It does works on other browsers but some JS may need to be amended slightly..but the actual innerHTML will work on other engines
-----Original Message----- From: Nick de Voil [mailto:[EMAIL PROTECTED] Sent: 11 August 2004 13:46 To: [EMAIL PROTECTED] Subject: Re: [ cf-dev ] SOT: javascript popup Sadly innerHTML only works in IE, whereas this page seems designed to work in other browsers including Netscape 4 judging from the stylesheet includes. Alternatively you could implement what's currently going in the popup as a separate CFM and do the processing server-side in CF rather than client-side in JS. Nick ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, August 11, 2004 1:29 PM Subject: RE: [ cf-dev ] SOT: javascript popup > > am i right in thinking there's a dropdown, you select a 'pack', which you > then want the details to be displayed on the page? you probably want to > have a named div in your page that you can write all this content to. > > function showPack(packName, packSubDir) { > > var packtext; > packtext = > '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">' + > '<HTML lang=en xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">' > + > '<HEAD>' + > '<TITLE>Slide pack: ' + packName + '</TITLE>' + > '<LINK href="../includes/css/ns4styles.css" type=text/css > rel=stylesheet>' + > '<LINK media=print href="styles/print.css" type=text/css > rel=stylesheet>' + > '<STYLE type=text/css media=all>@import url(styles/styles.css > );</STYLE>' + > '<SCRIPT language="JavaScript1.3" > src="scripts/notices.js"></SCRIPT>' + > '<SCRIPT language="JavaScript1.3" src="' + > packSubDir + '/slides.js"></SCRIPT>' + > '<SCRIPT language="JavaScript1.3" > src="scripts/slide_show.js"></SCRIPT>' + > '</HEAD>' + > '<BODY onload="initialise()" onUnload="closeQuestionPopup()" ' + > ' vlink="#333399" alink="#333399" ' + > ' link="#333399" onkeydown="keyCapture(window.event);">' + > '<TABLE cellSpacing=0 cellPadding=2 width=600 border=0 > align="center">' + > '<TBODY>' + > ' <TR><TD colspan="3" align="center">' + > ' <IMG name="slide" alt="Slide" src="" border="0"/>' + > ' </TD></TR>' + > ' <TR><TD colspan="3" align="center"><FONT size="-3" > color="#333399">' + > ' <DIV id="Notice"></DIV>' + > ' </FONT></TD></TR>' + > ' <TR align="center">' + > ' <TD align="left" width="25%"><DIV id="goBackward"></DIV></TD>' > + > ' <TD align="center" width="50%"><FONT color="#333399">' + > ' <DIV id="slideNo"></DIV></FONT></TD>' + > ' <TD align="right" width="25%"><DIV id="goForward"></DIV></TD>' > + > ' </TR>' + > ' <TR><TD colspan="3" align="center">' + > ' <IMG name="logo" alt="Logo" border=0/></TD><TR>' + > ' <TR>' + > ' <TD align="center"><DIV id="question"></DIV></TD>' + > ' <TD align="center"><A href="javascript: closeThisPopup()">' + > ' <FONT size="-2">Close window</FONT></A></TD>' + > ' <TD align="center"><A href="javascript: self.print()">' + > ' <FONT size="-2">Print</FONT></A></TD>' + > ' <TR>' + > '</TBODY>' + > '</TABLE>' + > '</BODY>' + > '</HTML>'; > > if(document.getElementById) > document.getElementById('packcontent').innerHTML = packtext; > else if(document.all) > document.all['packcontent'].innerHTML = packtext; > } > > the rest of the javascript functions seem fine. add this somewhere in the > body: > > <div id="packcontent"></div> > > you probably also want to remove the bits of html you won't need, such as > the doctype, head etc (these should already all be in your page). > > > > > [EMAIL PROTECTED] > gsi.gov.uk To: <[EMAIL PROTECTED]> > cc: > 11/08/2004 12:01 Subject: RE: [ cf-dev ] SOT: javascript popup > Please respond to dev > > > > > > Sorry for bringing js into the mix.... > Just trying to debug something for someone. Can anyone tell me if > there's a quick and dirty way to stop this function producing and popup > window? Just want the page to be created in the current browser: > > > Thanks! > Damien > ------------------------------------------------------------------------ > --------------------------------- > > > var havePopup = false; > var popup; > > function showPack(packName, packSubDir) { > if (!havePopup || popup.closed) { > // Open new popup > popup = window.open('', '', > 'toolbar=0,status=0,width=620,height=540'); > havePopup = true; > } > > // Open popup for writing > popup.document.open("text/html", "replace"); > > // Write HTML > popup.document.write( > '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">' + > '<HTML lang=en xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">' > + > '<HEAD>' + > '<TITLE>Slide pack: ' + packName + '</TITLE>' + > '<LINK href="../includes/css/ns4styles.css" type=text/css > rel=stylesheet>' + > '<LINK media=print href="styles/print.css" type=text/css > rel=stylesheet>' + > '<STYLE type=text/css media=all>@import url(styles/styles.css > );</STYLE>' + > '<SCRIPT language="JavaScript1.3" > src="scripts/notices.js"></SCRIPT>' + > '<SCRIPT language="JavaScript1.3" src="' + > packSubDir + '/slides.js"></SCRIPT>' + > '<SCRIPT language="JavaScript1.3" > src="scripts/slide_show.js"></SCRIPT>' + > '</HEAD>' + > '<BODY onload="initialise()" onUnload="closeQuestionPopup()" ' + > ' vlink="#333399" alink="#333399" ' + > ' link="#333399" onkeydown="keyCapture(window.event);">' + > '<TABLE cellSpacing=0 cellPadding=2 width=600 border=0 > align="center">' + > '<TBODY>' + > ' <TR><TD colspan="3" align="center">' + > ' <IMG name="slide" alt="Slide" src="" border="0"/>' + > ' </TD></TR>' + > ' <TR><TD colspan="3" align="center"><FONT size="-3" > color="#333399">' + > ' <DIV id="Notice"></DIV>' + > ' </FONT></TD></TR>' + > ' <TR align="center">' + > ' <TD align="left" width="25%"><DIV id="goBackward"></DIV></TD>' > + > ' <TD align="center" width="50%"><FONT color="#333399">' + > ' <DIV id="slideNo"></DIV></FONT></TD>' + > ' <TD align="right" width="25%"><DIV id="goForward"></DIV></TD>' > + > ' </TR>' + > ' <TR><TD colspan="3" align="center">' + > ' <IMG name="logo" alt="Logo" border=0/></TD><TR>' + > ' <TR>' + > ' <TD align="center"><DIV id="question"></DIV></TD>' + > ' <TD align="center"><A href="javascript: closeThisPopup()">' + > ' <FONT size="-2">Close window</FONT></A></TD>' + > ' <TD align="center"><A href="javascript: self.print()">' + > ' <FONT size="-2">Print</FONT></A></TD>' + > ' <TR>' + > '</TBODY>' + > '</TABLE>' + > '</BODY>' + > '</HTML>' > ); > > // Close popup for writing so first slide of new pack is displayed > popup.document.close(); > } > > > > function closePopup() { > // If the popup is open then close it > if (havePopup && !popup.closed) { > popup.close(); > havePopup = false; > } > } > > > > function initialise() { > for (i = 0; i < packs.length; i++) { > // Set the option text > document.forms["packSelect"].elements["packs"].options[i] = > new Option(packs[i][0]); > > // Set the option value to the array index > document.forms["packSelect"].elements["packs"].options[i].value = i; > } > } > > > > function newPack() { > // Get the index of the selected option > var idx = > document.forms["packSelect"].elements["packs"].selectedIndex; > > // Determine the new subdirectory to use and the number of slides > var val = > document.forms["packSelect"].elements["packs"].options[idx].value; > > var packName = packs[val][0]; > var packSubDir = "packs/" + packs[val][1]; > > // Open a popup window if necessary > showPack(packName, packSubDir); > } > > > > The original of this email was scanned for viruses by the Government Secure > Intranet (GSi) virus scanning service supplied exclusively by Energis in > partnership with MessageLabs. > > On leaving the GSi this email was certified virus-free > > -- > These lists are syncronised with the CFDeveloper forum at > http://forum.cfdeveloper.co.uk/ > Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > CFDeveloper Sponsors and contributors:- > *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided > by activepdf.com* > *Forums provided by fusetalk.com* :: *ProWorkFlow provided by > proworkflow.com* > *Tutorials provided by helmguru.com* :: *Lists hosted by > gradwell.com* > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > > > -- > These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ > Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > CFDeveloper Sponsors and contributors:- > *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* > *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* > *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED] This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant, Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions. Visit our website at http://www.reedexpo.com -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED]