jquery.redirect icon indicating copy to clipboard operation
jquery.redirect copied to clipboard

array data

Open bronte2k7 opened this issue 6 years ago • 6 comments

How can I do this? $.redirect("{% url "/login.php", {'id[]': [1, 2]}, 'GET');

can I transfer an object only?

bronte2k7 avatar Mar 07 '18 18:03 bronte2k7

Sorry, I don't understand what your are trying to do. whats {% url?

On Wed, Mar 7, 2018 at 7:23 PM, Bronte2k7 [email protected] wrote:

How can I do this? $.redirect("{% url "/login.php", {'id[]': [1, 2]}, 'GET');

can I transfer an object only?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mgalante/jquery.redirect/issues/36, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhCZeNAVC719iS342HxF6n5ZQg35qecks5tcCWggaJpZM4Sg7rK .

mgalante avatar Mar 11 '18 19:03 mgalante

I'm sorry for the mistake I am want get redirect with parameters $.redirect("url "/login.php", {'id[]': [1, 2]}, 'GET');

example.com/login.php?id=26&id=34

bronte2k7 avatar Mar 11 '18 20:03 bronte2k7

I encountered the same problem, the redirect does not allow the sending of arrays of objects in JSON, I modified the line of getInput method where is: else { name = parentString + "[" + name + "]"; } in name = parentString + "." + name I ask the author to check if it is correct.

albyx avatar Mar 19 '18 11:03 albyx

Can you provide an example of the data you are trying to send?

mgalante avatar May 30 '18 11:05 mgalante

I was facing the same issue. In my case Line 174 was the problem: else if (typeof values[propName] === 'object')

My passed array is also an object so the function calls itself over and over again.

So I changed it to: else if (typeof values[propName] === 'object' && !Array.isArray(values[propName])) I am not sure if it is clever.

I Think you are able to reproduce this issue with $.redirect("/login.php", {tmp: []}, "POST", "_blank");

wi-wissen avatar Jul 19 '18 12:07 wi-wissen

Im checking it

mgalante avatar Jul 28 '18 17:07 mgalante