si tienen un var js: html - cómo asignarlo a php var $ htmlPhp

  • lse123
  • Born
  • Born
  • No Avatar
  • Registrado: May 10, 2010
  • Mensajes: 3
  • Status: Offline

Nota Mayo 11th, 2010, 1:59 am

de
Código: [ Select ]
developer.yahoo/yui/editor/


si tienen un var js: [b] html [/ b] cómo asignarlo a php var $ htmlPhp (es el contenido del textarea - var incluye código HTML (tags))?

Obtener los datos desde el Editor
Hay un par de maneras de obtener los datos del editor. La primera manera es dejar que el editor lo haga por usted mediante el establecimiento de la opción de configuración handleSubmit.

Ajuste de la opción de configuración handleSubmit, el Editor intento de unirse a su pare no presentar formas evento. Entonces será llamar a su método saveHTML, a continuación, proceder con el envío del formulario.

El modo manual, es para llamar al método saveHTML ti mismo. De este modo:

JAVASCRIPT Código: [ Select ]
var myEditor = new YAHOO.widget.Editor('msgpost');myEditor.render(); //Inside an event handler after the Editor is renderedYAHOO.util.Event.on('somebutton', 'click', function() { //Put the HTML back into the text area myEditor.saveHTML(); //The var html will now have the contents of the textarea var html = myEditor.get('element').value;});
var myEditor = new YAHOO.widget.Editor('msgpost');
myEditor.render();
 
//Inside an event handler after the Editor is rendered
YAHOO.util.Event.on('somebutton', 'click', function() {
//Put the HTML back into the text area
myEditor.saveHTML();
 
//The var html will now have the contents of the textarea
var [b]html [/b]= myEditor.get('element').value;
});
  1. var myEditor = new YAHOO.widget.Editor('msgpost');myEditor.render(); //Inside an event handler after the Editor is renderedYAHOO.util.Event.on('somebutton', 'click', function() { //Put the HTML back into the text area myEditor.saveHTML(); //The var html will now have the contents of the textarea var html = myEditor.get('element').value;});
  2. var myEditor = new YAHOO.widget.Editor('msgpost');
  3. myEditor.render();
  4.  
  5. //Inside an event handler after the Editor is rendered
  6. YAHOO.util.Event.on('somebutton', 'click', function() {
  7. //Put the HTML back into the text area
  8. myEditor.saveHTML();
  9.  
  10. //The var html will now have the contents of the textarea
  11. var [b]html [/b]= myEditor.get('element').value;
  12. });
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Mayo 11th, 2010, 1:59 am

Publicar Información

  • Total de mensajes en este tema: 1 mensaje
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 224 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC