First, make another js file.
ex)common.js
var util = util || {};
util.ajax = function (url, data, done, fail) {
$.ajax({
url: url,
type: 'POST',
contentType: "application/json; charset=utf-8",
dataType: 'json',
data: data,
cache: false
}).done(done).fail(fail);
}
In all of your html files, you can use this function like this.
<script type="text/javascript" src="common.js"></script>
<script type="text/javascript">
$(document).ready(function() {
util.ajax('ClientSales.aspx/BindDatatoDropdown', {}, function (data) {
$.each(data.d, function (key, value) {
$('#%=ddlCategory.ClientID%>').append($("<option><;/option>").val(value.cat_id).html(value.cat_name));
});
},
function (data) {
});
});
</script>