jquery-bbq icon indicating copy to clipboard operation
jquery-bbq copied to clipboard

jQuery.param.querystring (build url) should use recursive merge (aka. deep copy).

Open Asgaroth opened this issue 13 years ago • 0 comments

jQuery.param.querystring (build url) does not currently merge params acordinly when using array typed queryStrings

Assume an URL like this:

var url = "?Obj[attr1]=a&Obj[attr2]=b";

If we wish to merge a data object like

var data = { Obj : { attr3 : c } };

we (or me) would expect the result from jQuery.param.querystring (url, data) to be:

"?Obj[attr1]=a&Obj[attr2]=b&Obj[attr3]=c"

But instead we get:

"?Obj[attr3]=c"

This is because when calling $.extend on jquery.bb-bbq.js at line 281, simple, and not recursive, merge is used

To solve this, the line should look like: : $.extend( true, {}, url_params, params ); // passed params override url params

which solves the issue and returns the expected url.

Asgaroth avatar Jan 12 '12 15:01 Asgaroth

The same here.

If you go back in an IE9 hashchanged frame, the URL you retrieve with Javascript (window.location) is still the same, from before the click on the Back button. But the URL in the properties for the frame has changed to what you would expect.

I've tried to find a solution by using (parts of) the hashchange code for IE6/7, with the iframe. But nothing even close to elegant.

thimo avatar Oct 13 '11 19:10 thimo

I have the same issue with IE8. I'm trying to solve this problem, but no clues so far.

chrisbenseler avatar Nov 28 '11 14:11 chrisbenseler

Hey hi!!!, any update on this issue?

cayasso avatar Dec 01 '11 15:12 cayasso

Hello guys, i have the same issue. Any update on this issue? Please help. Thank you very much. Regards, Cuong

cuongvu avatar May 15 '12 04:05 cuongvu

For now, no updates has been found. So sad ...

abucus avatar May 20 '14 03:05 abucus

Same issue. IE11,version: 11.0.9600.16428. hash history+frame.

claudia1204 avatar Jan 04 '15 08:01 claudia1204