What is this code for

D

Doug Stewart

I'm busy cleaning up my pages in order to sort out some search engine issues.
On my home page I have a piece of Java code but no idea of what it does.
Could anyone offer a view? I would like to delete it but am afraid of
possible long term consequences.

The reason I want to delete it is to move my keyword-rich body text earlier
in the page. I've recently taken a major search engine hit due to too much
stuff at the top of the page, so I have to do a major clean-up. The code I'm
asking about is:

<script language="JavaScript">
<!--
function FP_swapImg() {//v1.0
var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2;
n<args.length;
n+=2) { elm=FP_getObjectByID(args[n]); if(elm) {
doc.$imgSwaps[doc.$imgSwaps.length]=elm;
elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_preloadImgs() {//v1.0
var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
for(var i=0; i<a.length; i++) { d.FP_imgs=new Image;
d.FP_imgs.src=a; }
}

function FP_getObjectByID(id,o) {//v1.0
var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById)
el=o.getElementById(id);
else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return
el; } }
return null;
}
// -->
</script>

Thank you for any feedback,
Doug Stewart
 
J

Jon Spivey

Hi Doug,

That code does image rollovers - if you're using this feature don't delete
it if you're not you can. If you need the code best practice would be to
stick the code into an external file and then link it in with
<script type="text/javascript" src="YourScript.js"></script>
I doubt the search engines would hit you for that code though, there's
probably another reason
 
D

Doug Stewart

Jon

Thanks for the response. Could you tell me what a "image rollover" is? Does
it have anything to do with "JIMCO" spawn package (a package which allows one
to click on a link, which opens as a separate window)?

DOug

Jon Spivey said:
Hi Doug,

That code does image rollovers - if you're using this feature don't delete
it if you're not you can. If you need the code best practice would be to
stick the code into an external file and then link it in with
<script type="text/javascript" src="YourScript.js"></script>
I doubt the search engines would hit you for that code though, there's
probably another reason

--
Cheers,
Jon
Microsoft MVP

Doug Stewart said:
I'm busy cleaning up my pages in order to sort out some search engine
issues.
On my home page I have a piece of Java code but no idea of what it does.
Could anyone offer a view? I would like to delete it but am afraid of
possible long term consequences.

The reason I want to delete it is to move my keyword-rich body text
earlier
in the page. I've recently taken a major search engine hit due to too much
stuff at the top of the page, so I have to do a major clean-up. The code
I'm
asking about is:

<script language="JavaScript">
<!--
function FP_swapImg() {//v1.0
var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2;
n<args.length;
n+=2) { elm=FP_getObjectByID(args[n]); if(elm) {
doc.$imgSwaps[doc.$imgSwaps.length]=elm;
elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_preloadImgs() {//v1.0
var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
for(var i=0; i<a.length; i++) { d.FP_imgs=new Image;
d.FP_imgs.src=a; }
}

function FP_getObjectByID(id,o) {//v1.0
var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById)
el=o.getElementById(id);
else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return
el;
if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes;
if(c)
for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return
el; }
f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return
el; } }
return null;
}
// -->
</script>

Thank you for any feedback,
Doug Stewart

 
T

Tom Pepper Willett

An image rollover is basically two different images. One is displayed after
the page loaded up, the other one is displayed only when the user moves his
mouse over the first one.

Nothing to do with Spawn.
--
===
Tom "Pepper" Willett
Microsoft MVP - FrontPage
---
About FrontPage 2003:
http://office.microsoft.com/home/office.aspx?assetid=FX01085802
===
| Jon
|
| Thanks for the response. Could you tell me what a "image rollover" is?
Does
| it have anything to do with "JIMCO" spawn package (a package which allows
one
| to click on a link, which opens as a separate window)?
|
| DOug
|
| "Jon Spivey" wrote:
|
| > Hi Doug,
| >
| > That code does image rollovers - if you're using this feature don't
delete
| > it if you're not you can. If you need the code best practice would be to
| > stick the code into an external file and then link it in with
| > <script type="text/javascript" src="YourScript.js"></script>
| > I doubt the search engines would hit you for that code though, there's
| > probably another reason
| >
| > --
| > Cheers,
| > Jon
| > Microsoft MVP
| >
| > | > > I'm busy cleaning up my pages in order to sort out some search engine
| > > issues.
| > > On my home page I have a piece of Java code but no idea of what it
does.
| > > Could anyone offer a view? I would like to delete it but am afraid of
| > > possible long term consequences.
| > >
| > > The reason I want to delete it is to move my keyword-rich body text
| > > earlier
| > > in the page. I've recently taken a major search engine hit due to too
much
| > > stuff at the top of the page, so I have to do a major clean-up. The
code
| > > I'm
| > > asking about is:
| > >
| > > <script language="JavaScript">
| > > <!--
| > > function FP_swapImg() {//v1.0
| > > var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array();
for(n=2;
| > > n<args.length;
| > > n+=2) { elm=FP_getObjectByID(args[n]); if(elm) {
| > > doc.$imgSwaps[doc.$imgSwaps.length]=elm;
| > > elm.$src=elm.src; elm.src=args[n+1]; } }
| > > }
| > >
| > > function FP_preloadImgs() {//v1.0
| > > var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
| > > for(var i=0; i<a.length; i++) { d.FP_imgs=new Image;
| > > d.FP_imgs.src=a; }
| > > }
| > >
| > > function FP_getObjectByID(id,o) {//v1.0
| > > var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById)
| > > el=o.getElementById(id);
| > > else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el)
return
| > > el;
| > > if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes;
| > > if(c)
| > > for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el)
return
| > > el; }
| > > f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
| > > for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el)
return
| > > el; } }
| > > return null;
| > > }
| > > // -->
| > > </script>
| > >
| > > Thank you for any feedback,
| > > Doug Stewart
| >
| >
| >
 
S

Stefan B Rusynko

Probably from your interactive buttons
- leave it alone




| Jon
|
| Thanks for the response. Could you tell me what a "image rollover" is? Does
| it have anything to do with "JIMCO" spawn package (a package which allows one
| to click on a link, which opens as a separate window)?
|
| DOug
|
| "Jon Spivey" wrote:
|
| > Hi Doug,
| >
| > That code does image rollovers - if you're using this feature don't delete
| > it if you're not you can. If you need the code best practice would be to
| > stick the code into an external file and then link it in with
| > <script type="text/javascript" src="YourScript.js"></script>
| > I doubt the search engines would hit you for that code though, there's
| > probably another reason
| >
| > --
| > Cheers,
| > Jon
| > Microsoft MVP
| >
| > | > > I'm busy cleaning up my pages in order to sort out some search engine
| > > issues.
| > > On my home page I have a piece of Java code but no idea of what it does.
| > > Could anyone offer a view? I would like to delete it but am afraid of
| > > possible long term consequences.
| > >
| > > The reason I want to delete it is to move my keyword-rich body text
| > > earlier
| > > in the page. I've recently taken a major search engine hit due to too much
| > > stuff at the top of the page, so I have to do a major clean-up. The code
| > > I'm
| > > asking about is:
| > >
| > > <script language="JavaScript">
| > > <!--
| > > function FP_swapImg() {//v1.0
| > > var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2;
| > > n<args.length;
| > > n+=2) { elm=FP_getObjectByID(args[n]); if(elm) {
| > > doc.$imgSwaps[doc.$imgSwaps.length]=elm;
| > > elm.$src=elm.src; elm.src=args[n+1]; } }
| > > }
| > >
| > > function FP_preloadImgs() {//v1.0
| > > var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
| > > for(var i=0; i<a.length; i++) { d.FP_imgs=new Image;
| > > d.FP_imgs.src=a; }
| > > }
| > >
| > > function FP_getObjectByID(id,o) {//v1.0
| > > var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById)
| > > el=o.getElementById(id);
| > > else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return
| > > el;
| > > if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes;
| > > if(c)
| > > for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return
| > > el; }
| > > f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
| > > for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return
| > > el; } }
| > > return null;
| > > }
| > > // -->
| > > </script>
| > >
| > > Thank you for any feedback,
| > > Doug Stewart
| >
| >
| >
 
M

MikeR

And just to be really really picky, that isn't Java, it's javascript, and the two are not
related, except by an unfortunate attempt of one to tag onto the "popularity" of the other.
MikeR
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top