I tried to add this script I found online to an html file I use to store links Code: <body onload="makeMemory()"> The idea was to keep my place in a file that is full of links.(I'm using this as Windows 10 won't let me use links in an Excel or Quattro Pro file and the online fixes don't seem to work.) For some reason the script doesn't seem to work. Is there an error in it?
Is there a flaw in this script
1
I tried to add this script I found online to an html file I use to store links
The idea was to keep my place in a file that is full of links.(I'm using this as Windows 10 won't let me use links in an Excel or Quattro Pro file and the online fixes don't seem to work.)
For some reason the script doesn't seem to work. Is there an error in it?
Code:
<body onload="makeMemory()">
For some reason the script doesn't seem to work. Is there an error in it?
Code:
<script type="text/javascript">
var lastClickedLink = null;
function rememberLink() {
if (lastClickedLink) {lastClickedLink.style.color = "";}
lastClickedLink = this;
this.style.color = "red";
}
function makeMemory() {
for (var i=0; i<document.links.length; i++) {
var link = document.links[i];
if (link.addEventListener) {
link.addEventListener("click",rememberLink,false);
} else if (link.attachEvent) {
link.attachEvent("onclick",rememberLink);
} else {
link.onclick=rememberLink;
}
}
}
<script> - wayfarer
- [ 1 ] Thanks
- dmiller23576 Banned
Next Topics on Trending Feed
-
1