dandandan
Мой дом здесь!
- Регистрация
 - 7 Авг 2008
 
- Сообщения
 - 1.036
 
- Реакции
 - 293
 
- Автор темы
 - #1
 
С помощью ява скрипта делаю окно на div. Требуется, чтобы функция close_all() заработала.
	
	
	
		
	
		
			
		
		
	
				
			
		Код:
	
	function showError(text, ipadress){    
var content='<input name="sdlkfj" type="button" value="Закрыть" onclick="close_all();" />';
var divIdName = 'previewDiv';      
var newdiv = document.getElementById(divIdName);     
if(!newdiv){         
    newdiv = document.createElement('div');      
    newdiv.setAttribute('id', divIdName);      
    newdiv.setAttribute('class','block');      
    //Hide on click      
   /* newdiv.onclick = function(){ this.style.display = 'none';};      */
  
  var newButtonClose= document.createElement('button'); 
  newButtonSend.setAttribute('type', 'button');
  newButtonClose.onclick = function(){ this.style.display = 'none';};
  
  var newButtonSend= document.createElement('button'); 
  newButtonSend.setAttribute('type', 'submit');
  newButtonSend.onclick = function(){ send_data(); this.style.display = 'none';};   
  document.body.appendChild(newdiv);     
  } 
  //Overwrite new content      
newdiv.innerHTML = content; 
newdiv.style.display ='block';
newdiv.style.border ='1';
newdiv.style.background ='#C0DCC0';
newdiv.style.position ='fixed';
newdiv.style.overflow ='auto';
newdiv.style.width ='400px';
newdiv.style.height ='200px';
newdiv.style.left ='50%';
newdiv.style.top ='50%';
newdiv.style.marginLeft ='-200px';
newdiv.style.marginTop ='-100px';
}