Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#11333 closed bug (duplicate)

DOM bug: problem in IE8

Reported by: shinigam8@… Owned by: shinigam8@…
Priority: undecided Milestone: None
Component: unfiled Version: 1.7
Keywords: Cc:
Blocked by: Blocking:

Description

This code not run in IE8, but in others browsers run.

<html>
<head>
<title>TEST</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("button").click(function(){
    alert($("title").text());
    $("title").html("Hello World!");
    alert($("title").text());
  });
});
</script>
</head>

<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button>Click me</button>
</body>
</html>

Change History (6)

comment:1 Changed 8 years ago by sindresorhus

Owner: set to shinigam8@…
Status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

comment:2 Changed 8 years ago by sindresorhus

#11331 is a duplicate of this ticket.

comment:3 Changed 8 years ago by addyosmani

Status: pendingopen

comment:4 Changed 8 years ago by addyosmani

Resolution: duplicate
Status: openclosed

You have at least two options for getting/setting the document title. With jQuery you can use:

$(document).attr('title',title);

or for a simpler cross-browser compatible version:

var currentTitle = document.title;
document.title = 'something else';

comment:5 Changed 8 years ago by addyosmani

Duplicate of #2755.

comment:6 Changed 8 years ago by anonymous

thanks for your help!

Note: See TracTickets for help on using tickets.