Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
slam4:php:codeigniter:javascript [2012/12/20 19:03] – [POST sur click] jcheron | slam4:php:codeigniter:javascript [2019/08/31 14:21] (Version actuelle) – modification externe 127.0.0.1 | ||
---|---|---|---|
Ligne 14: | Ligne 14: | ||
===== Solutions possibles ===== | ===== Solutions possibles ===== | ||
Il est possible d' | Il est possible d' | ||
- | * JQuery | + | * [[slam4: |
* Prototype | * Prototype | ||
* Mootools | * Mootools | ||
Ligne 118: | Ligne 118: | ||
* **%%$ajax-> | * **%%$ajax-> | ||
- | <sxh php ; | + | <sxh php ; |
<?php | <?php | ||
Ligne 149: | Ligne 149: | ||
* **postResult** affiche le résultat du POST | * **postResult** affiche le résultat du POST | ||
- | <sxh php ; | + | <sxh php ; |
<?php | <?php | ||
class TestAjax extends CI_Controller{ | class TestAjax extends CI_Controller{ | ||
Ligne 171: | Ligne 171: | ||
* **%%$ajax-> | * **%%$ajax-> | ||
- | <sxh php ; | + | <sxh php ; |
<?php | <?php | ||
require_once " | require_once " | ||
Ligne 207: | Ligne 207: | ||
* **formSubmit** récupère le résultat du submit de vForm | * **formSubmit** récupère le résultat du submit de vForm | ||
- | <code php |h application/ | + | <sxh php ;title:application/ |
public function getForm(){ | public function getForm(){ | ||
$this-> | $this-> | ||
Ligne 215: | Ligne 215: | ||
$ajax-> | $ajax-> | ||
} | } | ||
- | </code> | + | </sxh> |
* Créer la vue **vForm.php** | * Créer la vue **vForm.php** | ||
* **%%$ajax-> | * **%%$ajax-> | ||
- | <code php|h application/ | + | <sxh php ;title:application/ |
<?php | <?php | ||
require_once " | require_once " | ||
Ligne 243: | Ligne 243: | ||
</ | </ | ||
</ | </ | ||
- | </code> | + | </sxh> |
=== Envoi vers une zone HTML === | === Envoi vers une zone HTML === | ||
Ligne 249: | Ligne 249: | ||
* Modifier la méthode du contrôleur en : | * Modifier la méthode du contrôleur en : | ||
- | <code php> | + | <sxh php> |
public function formSubmit(){ | public function formSubmit(){ | ||
$ajax = ajax(); | $ajax = ajax(); | ||
$ajax-> | $ajax-> | ||
} | } | ||
- | </code> | + | </sxh> |
< | < |