0

I have a page that uses jQuery to construct links and anchor tags based on existing HTML elements. It works in all browsers I tested except IE, where the output for the anchor tag was a little different.

Other browsers:

 <a class="courseshortcut" name="TitleJanuary12-13,2013"></a>

Internet Explorer:

 <a name="TitleJanuary12-13,2013" class="courseshortcut"/>

The generated links to these anchor tags look like this:

 <a href="#TitleJanuary12-13,2013">January 12-13, 2013 - Miami, FL</a>

The following section of code in the document.ready function adds the anchors:

 //adds the anchor tags
$('.courseentry').each(function() {
    var str = $(this).find('.coursetitle').html() + $(this).find('.coursedate').html();     
    $(this).prepend("<a class='courseshortcut' name='" + str.replace(/\s+/g, '') + "'></a>");
});

I can't figure out why this issue is occurring. Can someone enlighten me? A more complete version of the test script can be found here.

Drew02
  • 35
  • 9

2 Answers2

0

There are some invalid HTML in your page.Just open in IE and view in developer tool(F12). eg <div> is inside <p> find this link for more information

Community
  • 1
  • 1
  • I wasn't getting any errors in the IE developer view. I went ahead and cleaned up the page a bit, so there are no longer any errors when I use the w3.org validation page. The links to the anchor tags still won't function in IE. – Drew02 Feb 12 '13 at 15:37
-1

I think IE needs a file name or url before the hashtag

href="#TitleJanuary12-13,2013"

but i could stand corrected

Herb
  • 345
  • 1
  • 17