Ciao allora ieri sera dopo aver postato ho trovato (credo) un tuo articolo il seguente: link
Ho seguito tutto il tutorial. Quando però inserisco il nome utente la console javascript mi restitusce il segente errore:
Codice PHP:
Errore: uncaught exception: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIXPCComponents_Utils.import]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: file:///Users/Ghost87/Library/Application%20Support/Firefox/Profiles/zjexar82.default/extensions/%7Be0204bd5-9d31-402b-a99d-a6aa8ffebdca%7D/components/nsSessionStore3.js :: <TOP_LEVEL> :: line 111" data: no]
Cosa sbaglio?
Questi sono i miei file:
AsyncRequestController.php
Codice PHP:
<?php class AsyncRequestController extends Zend_Controller_Action { public function usernameAction(){ $utenti = array('zend', 'jquery', 'javascript'); $username = $this->_request->getParam('nome'); if ($username == ''){ $return = ''; }elseif (strlen($username) < 4){ $return = ' <p class="error">Nome Utente troppo corto!'; }elseif (in_array($username, $utenti)){ $return = ' </p><p class="error">Utente già esistente '; }else{ $return = ' </p><p class="ok">Nome Utente Valido '; } $this->_response->appendBody($return); $this->_helper->layout->disableLayout(); } } ?>
Ajax.js
Codice PHP:
$(document).ready(function(){
$("#name").bind('keyup',function(){
var baseUrl = "http://localhost";
var nome = $(this).val();
var destUrl = baseUrl + "/asyncrequest/username/nome/" + nome;
$.ajax({
url: destUrl,
type: 'GET',
success: function(responseText){
$("#message").html(responseText);
}
});
});
});
username.phtml
Codice PHP:
<?php echo $this->result; ?>
Se servono altre info le posto.
Grazie ancora