HighDots Forums  

it disappears

Javascript JavaScript language (comp.lang.javascript)


Discuss it disappears in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
davidrossdegroot@gmail.com
 
Posts: n/a

Default it disappears - 11-29-2007 , 11:21 AM






Hello, When I use this script it works fine, however, when I add a
link, by inserting a new "pageLink" in the array, and then it
dissappears on the screen... any ideas?

Thanks,
D.

var pageLinks = Array();
pageLinks[0] = "home";
pageLinks[1] = "a";
pageLinks[2] = "b";
pageLinks[3] = "c";
pageLinks[4] = "d";
pageLinks[5] = "e";
pageLinks[6] = "f";
pageLinks[7] = "g";
pageLinks[8] = "h";
pageLinks[9] = "organiz";
pageLinks[10] = "site";
pageLinks[11] = "notices";

function hideThisLink() {
var thisPage = unescape(window.location.href);
var linksLength = pageLinks.length;
for (i=0; i<linksLength; i++) {
var objectID = pageLinks[i];
var thisLink = findDOM(objectID,0);
var pathName = unescape(thisLink.pathname);
if (thisPage.indexOf(pathName)>-1) {
thisLink.style.display = "none";
}
}
}

document.writeln('<a id="home" href="index.htm"
style="display:inline">Home</a><br><br>');
document.writeln('<a id="a" href="a.htm" style="display:inline">A</
a><br><br>');
document.writeln('<a id="b" href="b.htm" style="display:inline">B</
a><br><br>');
document.writeln('<a id="c" href="c.htm" style="display:inline">C</
a><br><br>');
document.writeln('<a id="d" href="d.htm" style="display:inline">D</
a><br><br>');
document.writeln('<a id="e" href="e.htm" style="display:inline">E</
a><br><br>');
document.writeln('<a id="f" href="f.htm" style="display:inline">F</
a><br><br>');
document.writeln('<a id="g" href="g.htm" style="display:inline">G</
a><br><br>');
document.writeln('<a id="h" href="h.htm" style="display:inline">H</
a><br><br><br>');

Reply With Quote
  #2  
Old   
Good Man
 
Posts: n/a

Default Re: it disappears - 11-29-2007 , 12:55 PM






davidrossdegroot (AT) gmail (DOT) com wrote in news:a7bb731f-95f9-4321-85e8-
b8ef40c4113a (AT) p69g2000hsa (DOT) googlegroups.com:

Quote:
Hello, When I use this script it works fine, however, when I add a
link, by inserting a new "pageLink" in the array, and then it
dissappears on the screen... any ideas?
Um, this?

Quote:
if (thisPage.indexOf(pathName)>-1) {
thisLink.style.display = "none";
}


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.