#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Location
    United States
    Posts
    10
    Rep Power
    0

    Talking Ajax Form Submission Question


    Hello,

    Very new to Jquery. I don't think I need to show any code for this question but if I do I'll provide some.

    here it is ...
    I submit a form with an ajax call. It works fine 99% of the time. In the PHP script I return a value via echo <value> then exit immediately so the rest of the script isn't executed. ( so you get the seemless ajax effect )

    Most of the time the value is returned to the .ajax call and it works great but sometimes my <value> will print out directly to the browser and exit. So all you see after you hit "submit" is a number.

    Are you familiar with this behavior and if so what am I doing wrong ? Is this normal sometimes with ajax ? How can I reduce it's occurrence ? Maybe it's a PHP isssue or server config issue ?

    thank you in advance
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Location
    United States
    Posts
    10
    Rep Power
    0
    I think using an output buffer will stop this from happening . I know it's not totally a javascript question but it seems to be related.

    Code:
    ob_start();
    echo <value>;
    ob_end_flush();
    thanks, anyway. seems to be resolved.

IMN logo majestic logo threadwatch logo seochat tools logo