llorax
04-27-2007, 06:57 PM
is there a javascript command that is the same as <?php include (page); ?>? I'm writing a page using javascript and the page is getting too long. I'd like to have it pull in other sources.
Also my site is built like so:
function projects() {
document.getElementById("content").innerJS = "<h1>Past Projects</h1><br><h2>yesterday's work...</h2>
<script type="text/javascript">
//Define your own array to hold the photo album images
//Syntax: ["path_to_thumbnail", "opt_image_title", "opt_destinationurl", "opt_linktarget"]
var myvacation=new Array()
myvacation[0]=["../photo1.jpg", "", "photo1-large.jpg"]
myvacation[1]=["photo2.jpg", "Our car", ""]
myvacation[2]=["photo3.jpg", "Our dog", "photo3-large.jpg"]
myvacation[3]=["photo4.jpg", "Our hotel", "http://www.gohawaii.com/"]
//initiate a photo gallery
//Syntax: new photogallery(imagearray, cols, rows, tablewidth, tableheight, opt_[paginatetext_prefix, paginatetext_linkprefix])
var thepics=new photogallery(myvacation, 3, 1, '700px', '600px') </script>";
}
function contact() {
document.getElementById("content").innerHTML = "<h1>Contact</h1><br><h2>my 411...</h2>";
}
</script>
When I put javascript inside the element it destroys the rest of the code. How can I fix that?
Also my site is built like so:
function projects() {
document.getElementById("content").innerJS = "<h1>Past Projects</h1><br><h2>yesterday's work...</h2>
<script type="text/javascript">
//Define your own array to hold the photo album images
//Syntax: ["path_to_thumbnail", "opt_image_title", "opt_destinationurl", "opt_linktarget"]
var myvacation=new Array()
myvacation[0]=["../photo1.jpg", "", "photo1-large.jpg"]
myvacation[1]=["photo2.jpg", "Our car", ""]
myvacation[2]=["photo3.jpg", "Our dog", "photo3-large.jpg"]
myvacation[3]=["photo4.jpg", "Our hotel", "http://www.gohawaii.com/"]
//initiate a photo gallery
//Syntax: new photogallery(imagearray, cols, rows, tablewidth, tableheight, opt_[paginatetext_prefix, paginatetext_linkprefix])
var thepics=new photogallery(myvacation, 3, 1, '700px', '600px') </script>";
}
function contact() {
document.getElementById("content").innerHTML = "<h1>Contact</h1><br><h2>my 411...</h2>";
}
</script>
When I put javascript inside the element it destroys the rest of the code. How can I fix that?