|
-
Jun 17th, 2005, 09:57 AM
#1
Thread Starter
PowerPoster
JavaScript Window
Ok i've built up a gallery for a client and i ahd each thumnail loading up ina seperate window. But he decided he wanted javascript windows.
Now then I'm a javascript N00b and dont really want tpo get into it but do need some help with this.
Code:
<SCRIPT LANGUAGE="JavaScript">
function show_photo(pFileName,pTitle,pCaption) {
photoWin = window.open( "", "Cerys Gallery", "width=600,height=450, status,scrollbars,resizable,screenX=20,screenY=40,left=20,top=40");
photoWin.document.write('<html><head><title>' + pTitle + '</title></head>');
photoWin.document.write('<BODY BGCOLOR=#000000 TEXT=#FFFFCC LINK=#33CCFF VLINK=#FF6666>');
photoWin.document.write('<center>');
photoWin.document.write('<font size=+3 face="arial,helvetica"><b>' + pCaption + '</b></font><br>');
photoWin.document.write('<img src="' + pFileName + '"><p>');
photoWin.document.write('<font face="arial,helvetica">');
photoWin.document.write('"' + pTitle + '"<br>');
photoWin.document.write('<p></font></body></html>');
photoWin.document.close();
if (navigator.appName.substring(0,8) == "Netscape") photoWin.focus();
}
</SCRIPT>
and i am trying to set a link of each picture file to load its picture/captiona dn title in this javascript widnow.
PHP Code:
echo "<a href='javascript:show_photo(" . $path . "," . $title . "," $caption ")>";
echo "<img src='" . $path . "' width='100'></a></td>";
As we can see i'm mixing Php/Html/Javascript 
This does nothing can anyone explain to me how to use the function above corrrctly?
-
Jun 17th, 2005, 03:33 PM
#2
Thread Starter
PowerPoster
Re: JavaScript Window
Anyone any thoughts? I'm stuck here and i have a client on my back
-
Jun 17th, 2005, 06:16 PM
#3
Re: JavaScript Window
You say it does nothing? No popup window?
This is a snippet of some of my js code for a popup window. Note that the parameters for the popup are in the format - scrollbars=False ....
Code:
function openPopWin(winURL, winWidth, winHeight, winScroll) {
var winOptions = 'menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=' + winScroll + ',resizable=yes,width=' + winWidth + ',height=' + winHeight;
popup = window.open(winURL, 'popup', winOptions);
}
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jun 17th, 2005, 06:25 PM
#4
Re: JavaScript Window
Oh ya, and I just noticed that your not using the escape character for your document.write code.
Code:
.document.write("<html><head><title>Loading Image, Please Wait...<\/title><\/head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 text='",imgWidth,imgHeight,"'><center><a href='#' onClick =javascript:window.close()><img src='",imgName,"' alt='Click to Close' border='0'><\/a><\/center><\/body><\/html>")
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jun 18th, 2005, 05:17 PM
#5
Fanatic Member
Re: JavaScript Window
just a little point (if you want it!)... you dont need to seperate the variables form the output, unless you use the single quote. also you can do a line return in an echo statement 
PHP Code:
echo "<a href='javascript:show_photo(" . $path . "," . $title . "," $caption ")>";
echo "<img src='" . $path . "' width='100'></a></td>";
to:
PHP Code:
echo "<a href='javascript:show_photo($path,$title,$caption)'>
<img src='$path' width='100'></a></td>";
just thought i'd let you know 
PS: you are missing your end single quote of the first line of that php code! (i added in the second snippit)
Last edited by ALL; Jun 18th, 2005 at 05:22 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|