Si vous avez un var JS: html - Comment assigner à php $ var htmlPhp

  • lse123
  • Born
  • Born
  • No Avatar
  • Inscription: Mai 10, 2010
  • Messages: 3
  • Status: Offline

Message Mai 11th, 2010, 1:59 am

à partir de
Code: [ Select ]
developer.yahoo/yui/editor/


Si vous avez un var JS:] [b] [HTML b / comment assigner à php $ var htmlPhp (c'est le contenu du textarea - var contient du code html (tags))?

Obtenir les données de l'éditeur
Il ya deux façons d'obtenir les données de l'éditeur. La première façon est de laisser l'éditeur de le faire pour vous en définissant l'option de configuration handleSubmit.

Définition de l'option de configuration handleSubmit, le rédacteur en chef tente de se joindre à son pare des formes non présenter l'événement. Puis il appelle sa méthode saveHTML, puis procéder à l'envoi du formulaire.

La manière manuelle, est d'appeler la méthode saveHTML vous-même. Comme ceci:

JAVASCRIPT Code: [ 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
  • Inscription: 25 Feb 2008
  • Messages: ?
  • Loc: Ozzuland
  • Status: Online

Message Mai 11th, 2010, 1:59 am

Afficher de l'information

  • Total des messages de ce sujet: 1 message
  • Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 108 invités
  • Vous ne pouvez pas poster de nouveaux sujets
  • Vous ne pouvez pas répondre aux sujets
  • Vous ne pouvez pas éditer vos messages
  • Vous ne pouvez pas supprimer vos messages
  • Vous ne pouvez pas joindre des fichiers
 
 

© 2011 Unmelted, LLC. Ozzu® est une marque déposée de Unmelted, LLC