litbynature
08-23-2005, 11:52 AM
Hi....
Thank you in advance for your patience/time. I am new to this stuff.
I want to create a function [in the footer] of my web pages that scans the pages for PDF files, translate the path, and open it to a new window.
for example...
when a user clicks on a PDF link....
i would like a function to translate the path [through a decision statement] to decipher between a testing server and a live server path, then open the PDF in a new window.
is this possible???
an awesome webdeveloper.com member sent me this about a week ago. on the right track, but i could not build off of this. it might help you.
onload=function()
{
var links=document.getElementsByTagName("A"), pdfs=[], i=0, e;
while (e=links[i++])
if ((e=e.href).indexOf(".pdf")+4==e.length)
pdfs.push(e);
alert(pdfs);
}
THANK YOU FOR ALL OF YOUR HELP!!!!!
michel
Thank you in advance for your patience/time. I am new to this stuff.
I want to create a function [in the footer] of my web pages that scans the pages for PDF files, translate the path, and open it to a new window.
for example...
when a user clicks on a PDF link....
i would like a function to translate the path [through a decision statement] to decipher between a testing server and a live server path, then open the PDF in a new window.
is this possible???
an awesome webdeveloper.com member sent me this about a week ago. on the right track, but i could not build off of this. it might help you.
onload=function()
{
var links=document.getElementsByTagName("A"), pdfs=[], i=0, e;
while (e=links[i++])
if ((e=e.href).indexOf(".pdf")+4==e.length)
pdfs.push(e);
alert(pdfs);
}
THANK YOU FOR ALL OF YOUR HELP!!!!!
michel