Bug Tracker

Modify

Ticket #6602 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

Chrome can't do: $(...).load(url, title);

Reported by: matrym Owned by:
Priority: Milestone: 1.4.3
Component: ajax Version: 1.4.2
Keywords: Cc:
Blocking: Blocked by:

Description

The solution was resolved to my satisfaction on stack overflow. I recommend either updating the documentation to explain the limitations, or adjusting the method to be cross-browser:

 http://stackoverflow.com/questions/2911930/jquery-cant-load-the-head-title-in-chrome

TLDR:

$.get(" http://fiddle.jshell.net/",

function(response){

alert((/<title>(.*?)<\/title>/m).exec(response)[1]);

});​

Change History

comment:1 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

The documentation for .load() currently says:

Note that the document retrieved cannot be a full HTML document; that is, it cannot include (for example) <html>, <title>, or <head> elements. jQuery uses the browser's innerHTML property on a <div> element to parse the document, and most browsers will not allow non-body elements to be parsed in this way.

your example on SO seems to violate that rule. It might work on some browsers but is specifically documented as not supported.

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.