I'm having an odd issue that i can't recreate in jsbin.
i have an anchor tag:
- <a class="navigateToCategory" href="#523">Instruments</a>
and the code below:
- $('.navigateToCategory').bind('click',function(e){
- e.preventDefault();
- alert($(this).attr('href'));
- });
IE will give me "http://mydomain/index.cfm#523" while all other browsers give me "#523".
I tried to recreate this using a small test case, but i can't do it. IE always returns the "#523" just like all the other browsers. here's a jsbin of it working
http://jsbin.com/unowe3/13
any ideas why .attr('href') would be different in IE vs Other browsers on my page but not jsbin? i'm using the same doctype and version of jquery, and identical code. i can't think of any code that i could have written that would affect how .attr('href') works.
Edit: i did build a "hacky" solution for it by using $.browser.msie and an if statement, but it doesn't make any sense to me why it would be different in my situation vs any other.(not to mention, if it for some reason starts working properly, the "hacky" solution will cause it to not work)