Skip to main content

Bug Tracker

Side navigation

#2174 closed bug (fixed)

Opened January 16, 2008 01:16AM UTC

Closed January 17, 2008 09:43PM UTC

Last modified October 08, 2013 01:08PM UTC

"Invalid Label" error in FF2 doing JSON AJAX request

Reported by: dalangalma Owned by:
Priority: major Milestone: 1.2.3
Component: core Version: 1.2.2
Keywords: Cc:
Blocked by: Blocking:
Description

This seems to be a bug introduced in jQuery 1.2.2, since it works in 1.2.1:

I'm making an AJAX call like:

$.ajax({

dataType: "json",

success: function() { ... },

error: function() { ... },

url: "http://localhost:8080/myurl"

});

Firefox responds with "Invalid Label". If I change the url to "/myurl", it works. In jQuery 1.2.1, both work.

Attachments (0)
Change History (4)

Changed January 16, 2008 09:32PM UTC by osuchw comment:1

Here is use case that breaks in jquery-1.2.2 and Firefox

Let's assume the form tag is generated dynamically and javascript is static and in separate file.

<html>
<head>
	<script type="text/javascript" src="jquery-1.2.2.min.js"></script>
	<script type="text/javascript">
	$(function() {			
		var url = document.forms[0].action;
		//var url = '/notification/proxy.cfm/user/';
		$.getJSON(url,
			function(result){
				alert(result.rows.length);
				}
			);
	})
	</script>
</head>
<body>
	<form action="/notification/proxy.cfm/user/" type="GET">
	</form>
</body>
</html>

Changed January 17, 2008 05:34AM UTC by balupton comment:2

By using POST instead of GET the problem is avoided.

Works:

	// Do Ajax
	$.ajax({
		type: 'POST',
		url: 'http://localhost/path/actions.ajax.php',
		data: {test:'case'},
		dataType: 'json',
		success: function(result){
			alert(result);
		},
		error: function (XMLHttpRequest, textStatus, errorThrown) {
			alert(errorThrown);
		}
	});

Fails:

	// Do Ajax
	$.ajax({
		url: 'http://localhost/path/actions.ajax.php',
		data: {test:'case'},
		dataType: 'json',
		success: function(result){
			alert(result);
		},
		error: function (XMLHttpRequest, textStatus, errorThrown) {
			alert(errorThrown);
		}
	});

Changed January 17, 2008 09:43PM UTC by davidserduke comment:3

resolution: → fixed
status: newclosed

Ok, this should be fixed with [4476]. See the changeset for details. This change essentially returns the line to the way it was in 1.2.1 which was working.

Changed October 08, 2013 01:08PM UTC by anonymous comment:4

it is not working