bugduc Posted April 2, 2009 Share Posted April 2, 2009 I have a Zend 1.7.6 app using Dojo 1.3. I am using dojo.xhrPost to send a form to a controller in Zend. The front controller is setup with "noViewRendered". When the xhrPost call happens, everything works as planned except for the response. The response received is "<meta http-equiv="content-type" content="text/html;charset=utf-8">91", where 91 is the ID I am sending back. I expect to receive only the 91 in the response but I am getting the meta tag as well. Does anyone know where this is getting set/picked up? Code for controller and javascript is as follows: function saveFamily(divToUpdate) { if(dijit.byId('formFamily').validate()) { dojo.xhrPost({ url: "/family/add", load: function(response, ioArgs){ alert(response); if(Number(familyID) > 0) { dojo.publish("guardianTopic", [{ message: "Family information saved!", type: "message", duration: 2000 }]); document.getElementById('familyId').value = familyID; dojo.byId('formFamily').disabled = true; dijit.byId('guardianFirstName').focus(); } else alert('Ouch!'); return response; }, error: function(response, ioArgs){ dojo.byId(divToUpdate).innerHTML = "An error occurred, with response: " + response; return response; }, form: "formFamily", handleAs: "text" }); //dojo.byId('address1').disabled = !dojo.byId('address1').disabled; //document.getElementById('familyId').value = '1'; } } public function addAction() { try { $req = $this->_request; $posts = $req->getPost(); $family = new Model_DbTable_Family(); $data = array('family_name' => $posts['familyLastName'], 'last_visit' => date('Y-n-j'), 'email' => $posts['email'], 'home_phone' => $posts['homePhone'], 'work_phone' => $posts['workPhone'], 'cell_phone' => $posts['cellPhone'] ); $familyId = $family->insert($data); echo $familyId; } catch(Exception $e) { echo '0'; } } Quote Link to comment https://forums.phpfreaks.com/topic/152318-zend-returning-meta-tag-during-xhrpost/ Share on other sites More sharing options...
Daniel0 Posted April 4, 2009 Share Posted April 4, 2009 It's none of that. It could come from anywhere inside your application. Check the layout file. Quote Link to comment https://forums.phpfreaks.com/topic/152318-zend-returning-meta-tag-during-xhrpost/#findComment-801053 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.