| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/HostingSpaces/admin/chatme24.com/wwwroot/_server/jquery/ |
Upload File : |
(function($) {
$.fn.location = function (options) {
return this.each(function() {
options = $.extend({
method: 'states',
location: 'tools_ajax.php',
elState: '#state',
elCity: '#city',
first_option_state: '- Select All -',
first_option_city: '- Select All -'
}, options);
var container = $(this);
container
.on('change', function() {
$.ajax({type: 'POST',
url: options.location,
data: {'cmd':'location',
'method': options.method,
'param': container.val()},
success: function(response){
switch (options.method) {
case 'states':
$(options.elState).html('<option value="0">'
+ options.first_option_state
+ '</option>' + response);
$(options.elCity).html('<option value="0">'
+ options.first_option_city
+ '</option>');
break
case 'cities':
$(options.elCity).html('<option value="0">'
+ options.first_option_city
+ '</option>' + response);
break
}
}
});
})
});
};
})(jQuery)