a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Hosting from $3.99 per month!

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions. dd

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

2 Javascripts - How to Make them External

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> 2 Javascripts - How to Make them External
Page: [1]
 
Peppergal

 

Posts: 2207
Joined: 9/20/2002
Status: offline

 
2 Javascripts - How to Make them External - 2/23/2007 12:19:51   
Help!

I have two javascripts running on this page:

www.pikewaynerealty.com

I would like to remove the code and put it in an external file but how do I link them? Do they each have to have their own .js file?

Could someone give me the "for dummies" explanation?

Will doing this help my search engine ranking? Enough to make it worthwhile? I have important text below both slideshows, but the slideshows are important to capture the interest of the visitors.

TIA

_____________________________

Northeast PA / Poconos/ Lake Wallenpaupack Real Estate
wallenpaupacklakeproperty.com
Karen's Real Estate Blog
jurgen

 

Posts: 391
Joined: 1/9/2007
From: Castle Rock, Colorado
Status: offline

 
RE: 2 Javascripts - How to Make them External - 2/23/2007 13:08:05   
quote:

ORIGINAL: Peppergal

Help!

I have two javascripts running on this page:

www.pikewaynerealty.com

I would like to remove the code and put it in an external file but how do I link them? Do they each have to have their own .js file?

Could someone give me the "for dummies" explanation?

Will doing this help my search engine ranking? Enough to make it worthwhile? I have important text below both slideshows, but the slideshows are important to capture the interest of the visitors.

TIA


It will certainly help both, yourself and in the search engine. Cleaning up your code will make it easier for you to read and work with. For the search engines less code to spider.

You can use "server side includes" to call the scripts from a different location.
:)

(in reply to Peppergal)
Peppergal

 

Posts: 2207
Joined: 9/20/2002
Status: offline

 
RE: 2 Javascripts - How to Make them External - 2/23/2007 13:53:03   
but how? I said I needed the "for dummies" explanation. :)

my site is pure Front Page- I usually do all edits from front page and save right on the server.

And how do I call them up on my home page? will they still be clickable ?

_____________________________

Northeast PA / Poconos/ Lake Wallenpaupack Real Estate
wallenpaupacklakeproperty.com
Karen's Real Estate Blog

(in reply to jurgen)
jurgen

 

Posts: 391
Joined: 1/9/2007
From: Castle Rock, Colorado
Status: offline

 
RE: 2 Javascripts - How to Make them External - 2/23/2007 15:11:32   
I usualy work with server side includes. You can do the same thing with PHP as well.
But since you are looking for FP information ..... here it is

FrontPage Includes Tutorial

(in reply to Peppergal)
Edge

 

Posts: 164
Joined: 10/12/2004
From: South Carolina
Status: offline

 
RE: 2 Javascripts - How to Make them External - 2/23/2007 22:04:15   
You should be able to put all this code into an external js file, in the same folder as the page that will reference it. Call it something like "slideshow.js"

<!--

/*
JavaScript Image slideshow:
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free JavaScript here!
*/

var slideimages=new Array()
var slidelinks=new Array()
function slideshowimages(){
for (i=0;i<slideshowimages.arguments.length;i++){
slideimages=new Image()
slideimages.src=slideshowimages.arguments
}
}

function slideshowlinks(){
for (i=0;i<slideshowlinks.arguments.length;i++)
slidelinks=slideshowlinks.arguments
}

function gotoshow(){
if (!window.winslide||winslide.closed)
winslide=window.open(slidelinks[whichlink])
else
winslide.location=slidelinks[whichlink]
winslide.focus()
}

//-->


Then add this in the HTML where you want the effect.

<script src="slideshow.js" language="javascript" type="text/javascript"></script>

Then do the same thing for the second slideshow, but call it slideshow2.js.

That has worked for me on most javascript files. I do the same thing with dates, email riddler, etc. But there have been a small number that I could not get to work outside the HTML file. Hopefully yours will work fine.

Good luck, Ed

_____________________________

Time is short, are you ready?

(in reply to jurgen)
Peppergal

 

Posts: 2207
Joined: 9/20/2002
Status: offline

 
RE: 2 Javascripts - How to Make them External - 2/25/2007 22:52:28   
Thanks, Ed - now, another question - one of the javascripts is split up into part being pasted in the head of the document, and the other part where the script actually is placed.

Do I put both of those parts in the external file?

_____________________________

Northeast PA / Poconos/ Lake Wallenpaupack Real Estate
wallenpaupacklakeproperty.com
Karen's Real Estate Blog

(in reply to Edge)
Edge

 

Posts: 164
Joined: 10/12/2004
From: South Carolina
Status: offline

 
RE: 2 Javascripts - How to Make them External - 2/26/2007 13:15:28   
I see js in the head and twice in the body. I did a test using three external js files.
http://www.edgesz28.com/test/peppergal/peppergal.htm

It seems to work okay since there are two areas on the test page rotating photos.

If you look at the code on the test page above, you can see the three places where an external file is referenced.

Save a copy of your original index file and give it try. It appears it will work fine for you.

Let us know how it goes.

Ed

_____________________________

Time is short, are you ready?

(in reply to Peppergal)
Peppergal

 

Posts: 2207
Joined: 9/20/2002
Status: offline

 
RE: 2 Javascripts - How to Make them External - 4/4/2007 11:47:28   
Ed, please forgive me for not coming back and thanking you. It worked, bless you! Thank you SO MUCH!



_____________________________

Northeast PA / Poconos/ Lake Wallenpaupack Real Estate
wallenpaupacklakeproperty.com
Karen's Real Estate Blog

(in reply to Edge)
jaybee

 

Posts: 14207
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: 2 Javascripts - How to Make them External - 4/4/2007 11:56:51   
quote:

ORIGINAL: jurgen

I usualy work with server side includes. You can do the same thing with PHP as well.
But since you are looking for FP information ..... here it is

FrontPage Includes Tutorial

Eh? How does that work with javascript?

Hiya Pep, good to see you back again, however briefly. :)

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to jurgen)
Peppergal

 

Posts: 2207
Joined: 9/20/2002
Status: offline

 
RE: 2 Javascripts - How to Make them External - 4/4/2007 12:38:39   
Thanks Jaybee. I refer a lot of people here. Right now I am only developing one website, no longer a designer, but a realtor!

I should come back more. :( I miss you guys!

_____________________________

Northeast PA / Poconos/ Lake Wallenpaupack Real Estate
wallenpaupacklakeproperty.com
Karen's Real Estate Blog

(in reply to jaybee)
jurgen

 

Posts: 391
Joined: 1/9/2007
From: Castle Rock, Colorado
Status: offline

 
RE: 2 Javascripts - How to Make them External - 4/4/2007 12:46:54   
quote:

ORIGINAL: jaybee


Eh? How does that work with javascript?


I didn't say anything about java.... hmmmm :)

_____________________________

Wedding Dresses Colorado

(in reply to jaybee)
Page:   [1]
OutFront Discoveries

All Forums >> Web Development >> General Web Development >> 2 Javascripts - How to Make them External
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts