Skip to main content

Bug Tracker

Side navigation

#6273 closed bug (worksforme)

Opened March 12, 2010 12:48PM UTC

Closed October 05, 2010 11:47PM UTC

.getJSON does not work for extra params. (?undefined=undefined)

Reported by: jq_johan Owned by:
Priority: low Milestone: 1.4.3
Component: ajax Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:
Description

<!DOCTYPE HTML PUBLIC "-W3CDTD HTML 4.01 Transitional//EN">

<html>

<head>

<script type="text/javascript" src="jquery-1.4.2.js"></script>

</head>

<body>

<script type="text/javascript">

var aoData = new Array();

aoData.push({a:"1"});

$.getJSON( "jsonpage.html", aoData, function (json) {});

</script>

</body>

</html>

The string sent to the server is:

http://localhost/jqueryjsontest/jsonpage.html?undefined=undefined

The parameters are sent as undefined.

Attachments (0)
Change History (1)

Changed October 05, 2010 11:47PM UTC by addyosmani comment:1

priority: → low
resolution: → worksforme
status: newclosed

I've recreated your test case on my server and was able to receive a response from the server-side file being called by JSON without any issues. This was confirmed as including the undefined=undefined parameter at the end of the URL called.

Please remember that the file you're calling and expecting a JSON response from needs to both be in valid JSON format but also needs to be sending back valid content-type information in the header if you're using something like PHP.

eg. header('Content-type: application/json')

If you are able to provide the contents of your jsonpage.html file for further review please feel free to submit a new ticket.