Javascript within include page (Full Version)

All Forums >> [Web Development] >> General Web Development



Message


oriscus -> Javascript within include page (2/5/2002 19:53:19)

I'm trying to use a page include that contains a javascript mouseover thingy. It works fine by itself, but when I try to use it as an included page the hoverbuttons don't work. Does the same in Netscape and MSIE. Any ideas?
See the js page at: http://www.ArizonaArts.org/header2.htm
The page I'm trying to include it into is: http://www.ArizonaArts.org/index1.htm




Gil -> RE: Javascript within include page (2/5/2002 20:28:51)

Try putting this:
<SCRIPT language="JavaScript">
<!--
if (document.images)
{
image_off=new Image(754,15);
image_off.src="img/hdr2/header1_09.gif";

image2=new Image(754,15);
image2.src="img/hdr2/09flash.gif";
image3=new Image(754,15);
image3.src="img/hdr2/09about.gif";
image4=new Image(754,15);
image4.src="img/hdr2/09artists.gif";
image5=new Image(754,15);
image5.src="img/hdr2/09orgs.gif";
image6=new Image(754,15);
image6.src="img/hdr2/09ed.gif";
image7=new Image(754,15);
image7.src="img/hdr2/09advo.gif";
image8=new Image(754,15);
image8.src="img/hdr2/09tep.gif";

}

function change1(picName,imgName)
{
if (document.images)
{
imgOn=eval(imgName + ".src");
document[picName].src= imgOn;
}
}
//-->
</SCRIPT>


in the body instead of the head.

FWIW, I never use an HTML page for an include - use a .txt file...


Gil Harvey
The Host Factory
Resellers are our Specialty
Find a Web Professional





garry -> RE: Javascript within include page (2/5/2002 20:40:07)

Hey Gil

This .txt file for the include is new to me!! Can you elaborate a bit.

Cheers from the Outback
Get your didgeridoos from http://www.didj-territory.com.au




Gil -> RE: Javascript within include page (2/5/2002 20:55:12)

I'm not sure how to "elaborate" - just write a file using html and save it as a .txt

No <HEAD> or <BODY> needed - A example might be <TABLE>
<TR>
<TD>
Some text here.
</TD>
</TR>
</HEAD>

Then use: <!--#include file="somename.txt" -->


Gil Harvey
The Host Factory
Resellers are our Specialty
Find a Web Professional





oriscus -> RE: Javascript within include page (2/5/2002 22:54:21)

Thanks for the advice. I put the preloader script in the body and stripped out everything else I could in the page. Seems to be working now.

FrontPage would not let me include a page that is not HTML. I had to use the HTML and BODY tags and save as HTML. Seems like you ought to be able to include any kind of text script.





LB -> RE: Javascript within include page (2/6/2002 0:39:47)

Thanks for the info, Gil! Strangely, I've never thought of that... and I'm sure MANY others haven't either.

oriscus - FP won't give you a choice of a text file in the drop down, but if you type in name.txt it will save it that way.

Linda

Rose Templates for Valentines Day




abbeyvet -> RE: Javascript within include page (2/6/2002 5:05:31)

quote:
FrontPage would not let me include a page that is not HTML


Including .txt files works for Server Side Includes (SSI) but not for FP includes. I always do it for SSI but if using FP includes I just strip out all but the very basics in include page so it is just:

<html><head></head><body>
The content
</body</html>

Katherine

++++++++++++++++++++++++
www.inkkdesign.com

"Dogs have owners, cats have staff"
Meeeooow!




Gil -> RE: Javascript within include page (2/6/2002 6:10:47)

I guess I date myself

Been using SSI for years and have never seen any reason to use FP includes.I assumed everyone knew how to use a .TXT file for SSI.

Is there any advantage to using the FP include?

Gil Harvey
The Host Factory
Resellers are our Specialty
Find a Web Professional





paperfish -> RE: Javascript within include page (2/6/2002 8:01:36)

I use SSIs and my included files have a .htm extension. I design the include page in FP, then switch to HTML view and strip off everything except the content and tags (i.e. <html>, <head>, or <body> tags) - never had a problem with FP trying to add code back in.

To save a file as .txt in FP, select All Files in the Save As dialogue box and then type in the file name with the the .txt extension.
Cheers

 




Reflect -> RE: Javascript within include page (2/6/2002 8:15:45)

Hi,

I was taught, and this is not gospel could be an old wives tale, that using SSI puts the load on the server side. Using FP includes puts the load on the client side. I always figured tax the client not the server.

On includes I always just used <body></body> and whatever inbetween. Never had an issue.

Brian

Work hard, play fair, stay sane




paperfish -> RE: Javascript within include page (2/7/2002 7:08:21)

GWJ

According to our resident technical wizard, there is a little more work for the server in the first instance, but the server caches the include, thus speeding up subsequent calls.

 




oriscus -> RE: Javascript within include page (2/7/2002 13:27:08)

One of the reasons I use FrontPage is because it has built in features like include pages and forms so I don't have to write CGI scripts, etc. I don't even know how to do a SSI or if my server would support them.

Is the FP include page feature actually a client-side feature, or does it use the FP server extensions? Aside from the miniscule performance difference in server vs. client side processing, is there any compelling reason to prefer one over the other?





abbeyvet -> RE: Javascript within include page (2/7/2002 17:30:17)

I have used both extensively - sometimes on the same page when the SSI is calling something from a script rather than from within an FP web. I have not noticed any significant difference in performance, nor has any been reported by any user.

In theory it is possible to use FP includes without having extensions, in practice I have found them to be dodgy, it seems that if you update the include page you have to FTP all the pages in which it is included again before it will show up. At least that has been my experience and it rather defets the purpose.

For me the biggest advantage of FP includes is that you can see the include in the final page when you are working on it, which is not the case with SSI. It is a small thing but it is nice to see all of the content when you are working on a page.

In most ways though I think it is six of one and half a dozen of the other.

Katherine

++++++++++++++++++++++++
www.inkkdesign.com

"Dogs have owners, cats have staff"
Meeeooow!




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0859375