Bug Tracker

Modify

Ticket #7737 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

load throws an exception set div content to empty string

Reported by: sedmicka Owned by: sedmicka
Priority: undecided Milestone: 1.6
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocking: Blocked by:

Description

Hi!

I'm loading dropdown option elements dynamicaly by the

$('#section').load('/action.ashx', function() {});

method. It gets data from server and in firefox it removes content of the #section div instead of swet the content from the response. Response content is ok. I checked it by firebug and also by this:

$('#section').load('/action.ashx', function(response, status, xhr) {alert(response);});

It displays response content from the server, but doesn't update #section div element! Content of the div is only removed.

Behaviour of the IE7 is that it throws exception and if I debug the script it jumps to the line where is "Syntax error, unrecognized expression:". Firefox doesn't throw any exception even there is no line in log.

I've checked my document and it is XHTML valid. If I change 'load' to

$('#section').html('test')

, it works great in all browsers.

I think there is a bug in the load method.

Change History

comment:1 follow-up: ↓ 2 Changed 3 years ago by jitter

  • Owner set to sedmicka
  • Status changed from new to pending

Thanks for taking the time to contribute to the jQuery project by writing a bug report.

Please submit a reduced test case, which reproduces the issue you are experiencing, on  http://jsfiddle.net. So that we can investigate this issue further.


 How to report bugs

comment:2 in reply to: ↑ 1 ; follow-up: ↓ 4 Changed 3 years ago by anonymous

well I understand, but I can't put here production code, sorry.

I've checked right now that:

$('#section').load('/action.ashx', function (response, status, xhr) {});

doesn't work (throws an exception in IE7 and clears div content in Firefox without any exception), but this:

$.get('#section', function (data, status) {
	if (status == 'success') {
		$('#special-fields-section').html(data);
	}
});

works in both (IE7 and Firefox)!

comment:3 Changed 3 years ago by sedmicka

  • Status changed from pending to new

mistake...working is this:

$.get('/action.ashx', function (data, status) {
	if (status == 'success') {
		$('#section').html(data);
	}
});

comment:4 in reply to: ↑ 2 Changed 3 years ago by jitter

  • Status changed from new to pending

Replying to anonymous:

well I understand, but I can't put here production code, sorry.

I didn't ask you to put any production code here. Just a test case which reproduces the problem else there is no way to debug this.  How to report bugs

comment:5 Changed 3 years ago by jitter

Any progress on this? Please provide a test case as there is no way to know what causes your problem.

comment:6 Changed 3 years ago by trac-o-bot

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

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

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.