Thursday, January 28, 2010

Re: Submit form data with ajax helper only work when the debug is on

I just found out that add a use('Debugger') in my controller will
solve the problem, but i still would like to know

1. Will it slow down my application?
2. What's the trick of the Debugger behind the wall, what's the root
difference of deubg > 0 and debug = 0

Snippet of my cakephp code attached (i'm using a jQuery plugin as the
replacement of the origin prototype form helper, i know the conflict
between prototype and jquery so i'm not using prototype anywhere):

<script src="/mysite/js/jquery.js" type="text/javascript"
language="javascript"></script>
<script src="/mysite/js/jquery.form.js" type="text/javascript"
language="javascript"></script>
<script src="/mysite/js/jquery.editable.js" type="text/javascript"
language="javascript"></script>

<span style="font-size:14pt;color:blue"><b>添加热点</b></span>
<div id="myform">
<?
echo $ajax->form('Marker', 'post', array
('onsubmit'=>'event.returnValue = false; return false;','model' =>
'Marker', 'url' => 'add', 'update' => 'myicons'));

On 29 Jan., 09:45, cricket <zijn.digi...@gmail.com> wrote:
> You'll have to post your Cake code, I think.
>
> Do you use Debugger class anywhere? Also, try putting some $this->log
> ('...') lines in.
>
> On Jan 28, 7:29 pm, Jeruliu <jeru....@gmail.com> wrote:
>
> > As captioned, this is very strange that i can't figure it out till
> > now.
> > I'm using Cakephp with the jquery to submit the form.
>
> > I've spent sometime to investigate the issue, here is my script in
> > html source
>
> > //<![CDATA[
> > jQuery('#form56388588').submit( function() {
> > jQuery('#form56388588').ajaxSubmit({
> > beforeSend:function(request) {
> > request.setRequestHeader('X-Update', 'myicons');},
> > success:function(data, textStatus) {
> > jQuery('#myicons').html(data);}, async:true, type:'post',
> > url:'/mysite/markers/add'}); return false;});
> > //]]>
>
> > Please be noted that when debug is on and off the html sources are
> > exactly the same but they come up with different enddings.
>
> > When debug is off the "data" in sucess function is empty, while i can
> > see sth when debug is on
>
> > This is a view page named add.ctp which is under the control of my
> > Markers Controller.
>
> > I'm suffering from it for 3 days, can anyone help?

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: