#11333 closed bug (duplicate)
DOM bug: problem in IE8
Reported by: | Owned by: | ||
---|---|---|---|
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 11 years ago by
Owner: | set to [email protected]… |
---|---|
Status: | new → pending |
comment:3 Changed 11 years ago by
Status: | pending → open |
---|
comment:4 Changed 11 years ago by
Resolution: | → duplicate |
---|---|
Status: | open → closed |
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';
Note: See
TracTickets for help on using
tickets.
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.