Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 7 years ago

#2174 closed bug (fixed)

"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.

Change History (4)

comment:1 Changed 12 years ago by osuchw

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>

comment:2 Changed 12 years ago by balupton

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);
		}
	});

comment:3 Changed 12 years ago by davidserduke

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.

comment:4 Changed 7 years ago by anonymous

it is not working

Note: See TracTickets for help on using tickets.