Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
We don't bite newbies here... much
 
PerlMonks  

Re: Repetitive HTML data

by theAcolyte (Pilgrim)
on Sep 26, 2003 at 00:38 UTC ( [id://294332]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Repetitive HTML data

Not to rain on anyone's parade, but this is something you don't need perl for at all -- not unless you need different data on each line. If your looking to repeat an element over and over and its completely static you have two other good choices:
  • Use Server Side Includes. This requires they be turned on by your webhost. Many don't allow it for security reasons.
  • Use the EMBED tag. The only real problem is only mozilla supports it properly for embedding HTML docs
  • Use an IFRAME. This is prolly easiest solution
  • Use the funky method described below

You can also do it with javascript... but then if the surfer has JS turned off... ouch?? So here's the JS way.

1) Make a .js doc thats all one line like this:
document.write("your HTML HERE");

2) in your main HTML doc where you want that file to be included you put the following line:
<script LANGUAGE="javascript" TYPE="text/javascript" SRC="include.js"></script>

For even MORE fun ... change the SRC to include.pl and write a perl file that dumps out 1 line of javascript which reads:
document.write("blahblahblah");

and you have a dynamic include. :-)

-Erik

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://294332]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.