Bug Tracker

Modify

Ticket #9428 (closed bug: duplicate)

Opened 2 years ago

Last modified 2 years ago

Changing href attribute value in IE 7+ also changes link text (innerHTML value)

Reported by: agtlewis Owned by:
Priority: low Milestone: 1.next
Component: attributes Version: 1.6.1
Keywords: Cc:
Blocking: Blocked by:

Description

<script type="text/javascript">
jQuery(document).ready(function(){
    jQuery(function() {
        jQuery("#articleBody a:not(.notrack)").attr("href", function(i, attr) {
            return 'http://domain.com/track_click.php?bid=13&pid=5037&destination=' + escape(attr);
        });
    });
});
</script>

<div id="articleBody" class="entry">
<p>Please contact me 555-1212 or by email at <a href="mailto:testing@domain.com" target="_blank">testing@domain.com</a></p>
</div>

Expected output:

<p>Please contact me 555-1212 or by email at <a href="http://domain.com/track_click.php?bid=13&amp;pid=5037&amp;destination=mailto%3Atesting@domain.com" target="_blank">testing@domain.com</a></p>

Actual output:

<p>Please contact me 555-1212 or by email at <a href="http://domain.com/track_click.php?bid=13&amp;pid=5037&amp;destination=mailto%3Atesting@domain.com" target="_blank">http://domain.com/track_click.php?bid=13&amp;pid=5037&amp;destination=mailto%3Atesting@domain.com</a></p>

Change History

comment:1 Changed 2 years ago by agtlewis

Forgot to add in the summary that this only applies to mailto links. The code already posted will demonstrate the problem when tested on certain IE versions. I am getting reports of this happening with IE 7, and I confirmed it happens with IE 8.

comment:2 Changed 2 years ago by weirdan@…

This has been reported and rejected as wontfix at least twice (not counting this ticket).

comment:3 Changed 2 years ago by timmywil

  • Priority changed from undecided to low
  • Resolution set to duplicate
  • Status changed from new to closed
  • Component changed from unfiled to attributes

actually patchwelcome

comment:4 Changed 2 years ago by timmywil

Duplicate of #8805.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.