Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/01/2013, 01:47
Avatar de juanito1712
juanito1712
 
Fecha de Ingreso: mayo-2010
Ubicación: Valencia
Mensajes: 1.124
Antigüedad: 14 años, 10 meses
Puntos: 66
crear botones para un objeto

estoy metiendome en el tema de prototipos con javascript y ando un poco perdido en un punto, el codigo es este

Código:
<script>
var wysi=function(target){
	this.editor;
	this.tgt=new String(target);
	this.$=function(id){
		return document.getElementById(id); 
	}
	//Generacion del editor y sus componentes
	this.$(this.tgt).innerHTML='<input type="button" id="'+this.tgt+'bold"/><br /> '+
'<iframe id="'+this.tgt+'ifr" width="100%" height="300" style=" border:1px solid #000;"></iframe>';
	this.editor=this.$(this.tgt+'ifr').contentDocument || this.$(this.tgt+'ifr').contentWindow.document; 
    this.editor.designMode='on'; 
	//Asignacion de funciones de los botones
	this.botBold=this.$(this.tgt+'bold');
	this.botBold.onmouseup=function(){ed1.editor.execCommand('bold', false, null)};
	
}

var ed1;
window.onload=function(){ 
    ed1=new wysi('wys');
} 
</script>
lo que trato de solventar es este punto
this.botBold.onmouseup=function(){ed1.editor.execC ommand('bold', false, null)};
pero bien, eso de meter ed1 dentro de la clase funciona pero no debe ser asi y no logro saber como preguntarle a google como se hace ese punto en concreto

Última edición por juanito1712; 17/01/2013 a las 03:32