send data with jquery.load() [closed]
Asked Answered
U

1

7

how do I send some data to the server in the .load() function of jquery. I tried this syntax:

$('container').load('path', {key: value});

but for some reason it doesn't work

Unwonted answered 9/2, 2012 at 21:0 Comment(2)
"It doesn't work" is never a good error description. Please describe what goes wrong, what error messages you get, etc. Also, there is a manualLalitta
Try posting the code you are using, else its impossible for us to help.Statutable
C
31

.load uses POST or GET depending on the parameter passed.

If it's an object, it uses POST:

$('container').load('path', {key: value});

Otherwise, it uses GET:

$('container').load('path', 'key=value');

Without any other info in your question, this is all I could come up with to help.

Cargill answered 9/2, 2012 at 21:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.