A LEGEND that prints on the bottom of each page..??

windows

Guest
I am designing a web report and the report is supposed to have A LEGEND that prints on the bottom of each page..<br />
<br />
How do i do it?<br />
<br />
Thank you!<!--content-->Have this in a separate .js file:<br />
<br />
to_go_in_legend="This is ";<br />
to_go_in_legend+="an example.";<br />
<br />
and then on every page in the head have:<br />
<br />
<script type="text/javascript" src=http://www.webdeveloper.com/forum/archive/index.php/"name_of_js_file.js"></script><br />
<br />
and then where you want the lengend written have:<br />
<br />
<script type="text/javascript"><!--<br />
document.write(to_go_in_legend);<br />
//--></script><br />
<br />
to create the .js file simply open notepad or wordpad or whatever it is that you use, type in the code at the beginning of this post and then click save as, then when the box comes up type: name_of_file.js<br />
<br />
The .js file extension MUST be included.<!--content-->That helps!!<br />
<br />
I am sorry, i did not give you a detailed description of my problem.. <br />
<br />
My web report outputs data from the database and because of that there is no specific page break.. i want this legend whenever the page breaks, which is not in my hands..<br />
<br />
So any suggestions, on this one..?<!--content-->By page break do you mean where the page ends, if so why can't you just put:<br />
<br />
<script type="text/javascript"><!--<br />
document.write(to_go_in_legend);<br />
//--></script><br />
<br />
at the end of the page?<!--content-->My thing is, i don't know where the page breaks.. my data is populated in an HTML table but if the query bring back 20 rows, than the data is going to spill over to next page, but if my query only brings back 5 rows, i will only have 1 page.. so i don't know, where my page is going to end..<br />
<br />
so is there a dynamic way of specifying where i can put certain text on a page and it should print on every page that is being printed..<!--content-->What you could do is build the page as you want it with an empty div tag where you will put the search results (or whatever) and then dynamically insert the content into the div tag so that it will extend and push the legend down to the bottom of the page.<br />
<br />
Give me a second and I'll come up with the code to insert text into a div tag using javascript.<!--content-->Here ya go, it won't work if you try and insert any tags:<br />
<br />
var content="Hi";<br />
<br />
document.getElementById('in_here').replaceChild(document.createTextNode('content;'), document.getElementById('in_here').firstChild)<br />
<br />
<div id="in_here"></div><br />
<br />
if you want to be able to insert tags use this non-standard (doesn't work in Netscape) version:<br />
<br />
var content="Hi";<br />
<br />
document.getElementById("in_here").innerHTML=content;<br />
<br />
<div id="in_here"></div><!--content-->i am not able to figure out what this code does..<br />
<br />
I cut and paste, the following in <HEAD><br />
<br />
var content="Hi"; <br />
<br />
document.getElementById('in_here').replaceChild(document.createTextNode('content;'), document.getElementById('in_here').firstChild) <br />
<br />
and the <div id="in_here">The Report..</div> tag in the body..<br />
<br />
<br />
what it does is shows - The Report - what is within the <DIV> tag on the top of the page..<br />
<br />
I am sorry, i am not following.. :(<!--content-->All it does is replace all of the content, within the element with the matching ID, with some new content that you give it. To look at it doesn't make much sense, like a lot of things in js, which is another reason why it may be better to use the second option.<!--content-->
 
Back
Top