JS 动态生成 select option

function ad_changed(obj) 
  {
  	id = obj.value;
  	Ajax.call('adv_auto.php?act=get_id&is_ajax=1', 'parent_id='+id, re_ad_changed, "GET", "JSON");
  }
  function re_ad_changed(result)
  {
  	child = document.getElementById('ad_id');
	child.options.length=0;
  	for(i = 0; i < result.content.length; i++)
  	{ 
  	  child.options.add(new Option());
  	  child.options[i].value = result.content[i].ad_id;
  	  child.options[i].text = result.content[i].ad_name;
   	}
   	child.style.display = "";
  	return ;
  }