Question

I tried to use Link Checker to find any broken links, but the second one is not included, the displayedPage.html shows 404 error, but it will not show in the Link Checker's report. What is the difference between the two <a></a>? Why wasn't the second one being checked as a link?

<a href="showpage.go?page=mypage&room=yours">
<span>my own room</span>
</a>

second:

<a onclick="javascript:window.open('my/displayedPage.html', '', 
 'width=590,height=450,scrollbars=no,resizable=no'); return true;"
 href="javascript:void(0)">Show Me</a>
Was it helpful?

Solution

The second one does not have an href attribute that can be checked with the link checker you are using.

Presumably, the program you are using does not understand the javascript: protocol and/or ignores any other protocols than http and ftp.

OTHER TIPS

It seems that your tool ignores javascript links. The second link is not a pure html link, it's a link created by calling javascript.

The second isn't a valid link, it requires javascript in order to work, something the link checker probably isn't checking (it is doing essentially static analysis I guess).

You should always have the href set to the link you want to open and attach javascript enhanced behavior, something like:

<a onclick="window.open(this.href, '', 
   'width=590,height=450,scrollbars=no,resizable=no'); return true;" 
   href="my/displayedPage.html" target="_blank">Show Me</a>

because in second one browser just executes javascript when you click this link. this script is opening link in new window with given params

The Link Checker doesn't know javascript

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top