views:

245

answers:

5

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>
+7  A: 

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.

Sinan Ünür
+1  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

Eldar Djafarov
+4  A: 

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.

Mercer Traieste
+1  A: 

The Link Checker doesn't know javascript

Mel Gerats
+4  A: 

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>
meandmycode
But I need the displayedPage.html to be loaded in a new browser while the old browser stay with the old page.
derrdji