how not to hard-code codeigniter link in js file
问题 i wrote the routine below to retrieve city based on selected country for my codeigniter application. $(document).ready(function() { $("select#cbo_country").change(function() { $.post("http://localhost/main/index.php/city/get_data_by_country", { int_country_id : $(this).val() }, function(data) { // some code here },'json'); }) }); as you can see, i hard-coded the url (http://localhost/main/index.php/city/get_data_by_country) and i know it's a bad practice but i can't help it. is there a nice