i want to send array in ajax json post ,but some code are error.how to fig this code?
HTML
相关标签:
-
2021-01-26 18:05
Don't use if(clickHandler)
style syntax, that will never trigger when you want it to, instead just define the click handler:
$('#save-menu').click(function() {
//do stuff on save-menu click
})
-
2021-01-26 18:13
Bind an event handler to the "click" JavaScript event, or trigger that event on an element.
$( "#save-menu" ).click(function() {
//Handler for .click() called.
$.post('menu/order',{...});
});
$( "#calculator" ).click(function() {
//Handler for .click() called.
$.post('menu/calculator',{...});
});
-
2021-01-26 18:14
It's the way you have the click events set up that are causing you your problems.
It should look more like this:
$('#save-menu').click(function() {
$.post(... ajax stuff...);
});