Bug Tracker

Modify

Ticket #10913 (closed bug: invalid)

Opened 18 months ago

Last modified 18 months ago

jQuery.html() - removes double spaces on IE7 and IE8

Reported by: Agnius101 Owned by:
Priority: low Milestone: None
Component: manipulation Version: 1.7.1
Keywords: Cc:
Blocking: Blocked by:

Description

  1. Set html value with double spaces:

$("#list").html('<li>List item with double spaces.</li>');

  1. Get html value:

$("#list").html();

  1. html() function returns value without double spaces on IE7 and IE8, while it returns expected value on IE9, FF and Chrome.

See example on and check console output:  http://jsfiddle.net/L6zq6/1/

Change History

comment:1 Changed 18 months ago by sindresorhus

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to manipulation

This is not a jQuery issue. Using alert( document.getElementById("list").innerHTML ); alerts the same thing on IE7/8

You could of course use <pre> or CSS white-space: pre to keep the whitespace. You could also replace the whitespace with the whitespace entitity &nbsp;

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.