Skip to main content

Bug Tracker

Side navigation

#7531 closed bug (fixed)

Opened November 16, 2010 10:05AM UTC

Closed December 06, 2010 10:22PM UTC

Last modified March 09, 2012 08:30PM UTC

$.post(document.location) doesn't work anymore since 1.4.3 on Firefox and Chrome

Reported by: xaviermd@gmail.com Owned by: snover
Priority: low Milestone: 1.5
Component: ajax Version: 1.4.4
Keywords: regression Cc:
Blocked by: Blocking:
Description

I created a veryu complex javascript onto jquery 1.4 and it was (nearly) perfectly working with 1.4.2 (I mean : it consumes a lot of RAM to make browser crashes very frequently).

Since 1.4.3 and 1.4.4 , $.post() command goes to javascript halts :

**** Firefox 3.6.12:

uncaught exception: [Exception... "Illegal operation on WrappedNative prototype object" nsresult: "0x8057000c (NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)" location: "JS frame :: https://myservice/interface/stage1.js :: anonymous :: line 5767" data: no]

the calling offender :

$.post(document.location,{action:'fresh' , ordre:"{\\"0\\":[\\"fonctions\\",\\"perso_message\\",\\"commandes\\"],\\"1\\":[\\"raccourcis\\",\\"suggestions\\"]}"},function(datas){ return something; },'json');

the lines 5762→ 5767 are :

ajax: function( origSettings ) {

var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings),

jsonp, status, data, type = s.type.toUpperCase(), noContent = rnoContent.test(type);

console.log(s.url);

console.log(rhash);

s.url = s.url.replace( rhash, "" );

s.url : Object { constructor={...}, href="https://myservice.../", more...}

rhash : /#.*$/

**** Chrome 6:

s.url : Object Location {

assign: function () { [native code] }

hash: "#.*$/"

host: "myservice..."

hostname: "myservice..."

href: "https://myservice.../#.*$/"

pathname: "/"

port: ""

protocol: "https:"

reload: function () { [native code] }

replace: function () { [native code] }

search: ""

toString: function toString() { [native code] }

valueOf: function valueOf() { [native code] }

__proto__: Location

}

rhash : /#.*$/

Failed to load resource: the server responded with a status of 404 (Not Found)

/undefined

**** Personnal note :

I believe the problem came from document.location which was not seen as an string anymore

Firefox doesn't like regex on objects, Chrome respond to the .replace by "undefined"

Attachments (0)
Change History (9)

Changed November 16, 2010 03:00PM UTC by addyosmani comment:1

owner: → xaviermd@gmail.com
status: newpending

Please include a valid complete test case on jsFiddle.net that reproduces the issue you are experiencing so that we can investigate further.

Changed November 16, 2010 03:32PM UTC by xaviermd@gmail.com comment:2

status: pendingnew

I don't understand jsFiddle.

Perhaps http://jsfiddle.net/KLrer/4/ ?

$.post(document.location,{},function(data){alert(data);},'html');

Changed November 16, 2010 03:34PM UTC by anonymous comment:3

GRAH. Askimet is eating my message.

http://jsfiddle.net/KLrer/4/ ?

$.post( document.location, {} ,function(data) {alert(data);},'html');

jQuery 1.4.3+ : no responses, silently fails (in fact, «uncaught exception»)

$.post( document.location.href, {} ,function(data) {alert(data);},'html');

jQuery 1.4.3+ : alert responds. works

Changed November 17, 2010 07:03AM UTC by snover comment:4

component: unfiledajax
keywords: → regression
milestone: 1.51.4.5
priority: undecidedlow
status: newopen

Changed November 17, 2010 07:07AM UTC by snover comment:5

Changed November 21, 2010 10:13PM UTC by snover comment:6

owner: xaviermd@gmail.comsnover
status: openassigned

Changed December 06, 2010 10:22PM UTC by john comment:7

resolution: → fixed
status: assignedclosed

Landed.

Changed January 14, 2011 10:20PM UTC by jitter comment:8

milestone: 1.4.51.5

Move fixed tickets to appropriate milestone

Changed February 12, 2011 03:00AM UTC by jaubourg comment:9

Enhances ajaxSetup so that it can take an optional target option, in which case target will be updated instead of ajaxSettings. That way, fields that shouldn't be deep extended can be listed and dealt with in one place. jQuery.ajax now makes use of ajaxSetup with target to create its internal settings object. Fixes #7531 in IE9RC.

Changeset: d4790116b8ff83786e82767cba23a4bff0236e58