May 16, 200719 yr Is there any way, using regular HTML, CSS, PHP or JavaScript to have a webpage automatically insert a certain corresponding icon before a link to a file that is not HTML, PHP or something else that is "regular" for the browser? I want to be able to let people know that the link is to PDF or PowerPoint or something like that, and I don't want to have to insert <img src="/icons/pdf.png" width="16" height="16" alt="PDF document" /> or something like that before every link to a certain file. Also it would be nice to be able to do something like what wikipedia does where if a link is external, it shows a little arrow next to it and is a slightly different color. Anyone know of a way to do this? This would be going on PHP pages, but any method with CSS or JavaScript or PHP or just plain old (X)HTML would work.
May 16, 200719 yr What first came to mind was a Greasemonkey script, but that only modifies the page locally.
May 16, 200719 yr For the links, I'd suggest looking at this directory listing script. I've got it running in my random files folder, and it posts icons before certain types of files.There's also this simple directory indexer that might get you going in the right direction.
Create an account or sign in to comment