In IE 8.0.6 and 6.5 (not my machine but on coworkers machine) when link gets clicked, i get full path including the ID like “http://www.domina.com/folder/12345” where as on my machine i get the ID only when i do
myval = $("#myLink").attr("href");
When i move the ID to rel attribute, the browsers behave as intended.
myval = $("#myLink").attr("rel");
I am confused now, same version of IE on my machine is behaving ok where as on coworkers machine it is not. Am i doing some thing wrong here?
$("#myLink").click(function () {
var id = $(this).attr('href');
alert(id);
return false;
});
But remember if someone has their JS disabled they will be directed to url.com/id_here. I would suggest placing the ID somewhere else and leaving the href as href=“#”
YBH305: false is in there. This is internal site and all users know to have js enabled.
JimmyP: I checked this on the same IE version but different machines. Like i said mine worked where as the coworkers didn’t. Thanks for the replace, i am currently using rel and it is working in all the browsers for me.