Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

PHP AJAX multiple calls

  • 21-03-2007 11:54AM
    #1
    Registered Users, Registered Users 2 Posts: 1,086 ✭✭✭


    I am using a html textarea to take in a reasonable large amount of text from a user. I firstly parse through the text and validate. Then after I have to store the necessary information.

    I could process it all in 1 using PHP but since it usually takes quite long I'd like to somehow use AJAX so the user can see the percent completed.
    What I do now is I recieve the input data and verify it using PHP and then load a page of javascript which will take one row at a time and store the information using AJAX to another PHP page. It only proceeds to the next row once the previous row has completed. However I am getting the popup "A script on this page may be busy, or it may have stopped responding. You can stop it now or continue to see if the script will continue.". I have the choice to stop script or continue.

    Am I doing this the most efficient way or not?

    Any Help?


Comments

  • Closed Accounts Posts: 884 ✭✭✭NutJob


    However I am getting the popup "A script on this page may be busy, or it may
    have stopped responding. You can stop it now or continue to see if the script will continue.". I have the choice to stop script or continue.

    That's a sign your script is running for a long time and you might need to re-think its design.

    Some code would be nice as i cant see how your trying to validate fields. It may be easier to just use regular expressions.... (hard to tell without more info)

    AJAX is useful if your moving through a long form with allot of data but its not the best at updating a data source.

    You have to write the web service behind it and the associated xml schema for the message passing, Debug the javascript, figure out how to update tables with drip fed info to a web service :(

    Splitting the form may be a quick answer if its possible.


Advertisement