I need code example for:
- custom JavaScript function that takes a single object as an argument
- uses jquery ajax method to make ajax call
- object argument should specify all possible values that can be customized.
- For example: type of ajax call, data to be passed, success, error handlers etc. etc.
- if any values are not present it should assume defaults
Here is a basic skeleton of the function you are trying to make.
Then you can call your function like so:
Here are the docs for
$.ajax, they may help: http://api.jquery.com/jQuery.ajax/