<lol> I am a top poster. I prefer it because it means the newest
material is at the top, so I don't have to actively hunt for the latest
text. I can read previous posts and see the response structure
graphically, so bottom posting is a waste of time in my view. Back
when one just had nn and such for newsgroup reading on one's 'nix
terminal, it made a lot more sense, but unless one is in a text only
environment with 80x24 columns, bottom posting is not useful IMO.
Then make the href point to the current page. Have a tooltip that
displays in the page giving information about the link. Seeing "#" in
the statusbar is useless to a user.
They don't see #, they see the page URL. At least they do on FF and
IE5.5 and above, which is all I am required to code to. In Opera,
those don't even show up as links, though the onclick does work (Opera
rocks for speed!). Anyway, since two of my bosses are the complainers,
and they read email from people who complained about it when I left it
off other pages, in the # goes! It's not my design decision to make,
alas.
As for problems with your code, start with the setAttribute problems (IE
has major problems with it) and ditch the eval stuff. Then post a URL to
a sample page that displays the problem.
I would LOVE to ditch the eval, I hate using it. It offends my sense
of programming style and good programming practices. Unfortunately, I
can't think of any other good way to insert the URL at runtime into the
call; since these pages are dynamically generated, I can't specify
ahead of time. I thought of a couple workarounds, but nothing that
seemed any more efficient or graceful than using eval (eg, chucking
things into a global array hashed on the element's ID and calling
GB_show(_URLs[this.id],470,600)). I'd be happy to hear any suggestions
for alternatives.
I did get rid of the setAttribute stuff already tho:
try { //IE will not allow name attribute to be set after element
creation
link =document.createElement("<a name='itemNo|" +intPartId +"'
href='#itemNo|" +intPartId +"' />");
}
catch (e) {
link =document.createElement("a");
link.setAttribute("name","itemNo|" +intPartId);
link.setAttribute("href","#itemNo|" +intPartId);
}
if(link.attachEvent) {
eval("link.attachEvent('onclick',function() { GB_show('"
+part.strDesc +"', '" +INFO_URL_BASE+part.infoUrl +"', 470, 600);
return false; },false)");
}
else {
eval("link.addEventListener('click',function() { GB_show('"
+part.strDesc +"', '" +INFO_URL_BASE+part.infoUrl +"', 470, 600);
return false; },false)");
}
I don't know why FF puts the # in the location bar when IE does not
when it returns false. I suspect FF evaluates both the href and the
onclick, while IE just evaluates the onclick.
Demo page at
http://65.110.86.247/Product_List3.asp
Relevant code is buried at line 82 in
http://65.110.86.247/ajax/js/view/ViewCatalog.js
Go easy on me, as this is only my second attempt at a web application,
and I'm also playing with a strict MVC architecture.
Tyler