Нужна небольшая помощь
Есть кусок js кода
CODE (javascript):
скопировать код в буфер обмена
скопировать код в буфер обмена
- <script type="text/javascript">
- var ajax = new Array();
- function getCityList(sel){
- var countryCode = sel.options[sel.selectedIndex].value;
- document.getElementById('subcat').options.length = 0;
- if(countryCode.length>0){
- var index = ajax.length;
- ajax[index] = new sack();
- ajax[index].requestFile = 'city.php?country='+countryCode;
- ajax[index].onCompletion = function(){ createCities(index) };
- ajax[index].runAJAX();
- }
- }
- function createCities(index) {
- var obj = document.getElementById('subcat');
- eval(ajax[index].response);
- }
- </script>