Forum Moderators: open
Or...You might want to do some kind of PHP or Perl scripting... Maybe something like this:
page.html:
<script language=javascript type="text/javascript">
<!--#include virtual="script.cgi"-->
</script>
script.cgi:
#!/usr/bin/perl
print "Content-type:text/html\n\n";
open(INPUT,"text.txt");
while(<INPUT>)
{
print;
}
I'm building on my web site an online Bible as a project to learn XML:
(http://www.clmitchell.net/Bible/index.html).
The goals of the project are:
1)To use a single, dynamically-updated (js) web page (XHTML) to present all the books of the Bible, one chapter at a time.
2)To render the actual text of each chapter from an XML file existing on the web dir on the server (i.e., Genesis is a single XML file with 50 chapters).
3)To Use javascript to update the web page depending on the choice of the user (i.e., i dont want to have a single, HUGE js file with all possible pages in it; but would rather CALL other javascript files from a single MAIN js file [i've already achieved some success so far].
what is working NOW is:
1)user presses a button on main web page.
2)button calls MAIN js file/function requesting a particular "page" rendering.
3)using a switch/case block, the appropriate js file is called by dynamically adding a <script> tag to the <head> tag that calls the requested script that will render the proper page.
4)div that contains the PRIMARY CONTENT (i.e. menus & chapters available) is cleared and updated [THIS IS WHERE THE PROBLEM IS!].
5) button behaviors are changed to match the options available for the new page.
what is NOT WORKING is that the background-image (declared in a linked stylesheet) for the div i am updating wont be updated (i send a command that replaces the default bg-image with a transparent gif:)
************************
//remove background image
if(IE6)document.all['DataTab'].style.backgroundImage = 'url(images/blank.gif) no-repeat';
if (NS6)document.getElementById('DataTab').style.background = 'url(images/blank.gif) no-repeat';
************************
i've tried EVERY COMBINATION of single- and double-quotes to get this code to replace the image without success...WHERE HAVE I ERRED?
if(navigator.appName.indexOf("Internet Explorer")!=-1)
{
document.all.DataTab.style.backgroundImage = 'url(images/blank.gif) no-repeat';
}
else if (navigator.appName.indexOf("Netscape")!=-1)
{
document.getElementById('DataTab').style.background = 'url(images/blank.gif) no-repeat';
}
however, while the NS6 Javascript Console gives no error the default background image doesn't go away, either.
I'm assuming that the new image REPLACES the old one...but is it just "siting on top of" the original image (blank.gif is a single-pixel transparency)?
<div background="image.jpg">
content
</div>
Let me know if this solves the problem.
Cheers,
Krishna.