Web Programming Tip -
JavaScript
by Jon Schlackl
All SEO ArticlesThis article from The Mender (Issue 1),
Metamend's Web Site Optimization and Marketing Newsletter.
Javascript: Ever wanted to have a "print" button inside your web page so the user doesn't have to use the print button in the browser?? Well, here is a little code that will give it to. This small piece of Javascript invokes the browser's print function directly. Cut and Paste this code for use:
<a href="Javascript:window.print();">PRINT</a>Note: replace the "PRINT" label with other text or an image for the print button.
Perl: Parsing out the filename and/or path from a string can be tricky, but very useful. Check these out!
$filename =~ s/.*\///; - isolates filename $path =~ s/.*\/.*/$1/; - isolates pathOR to get both:
if($string =~ /.*\/.*/){
$path = $1;
$filename = $2;}
Other articles from this issue:
- Administrator's Corner
- Web Browsers
