|
| |
|
|
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 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
|
|
|
|
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?
|
|
|
|
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
|
|
|
|
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?
|
|
|
|
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
|
|
|
|
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
|
|
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
|
|
|