Jump to content

vortexbased

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Everything posted by vortexbased

  1. I have tried and think this is the closest I have gotten to something that could work, of course it doesn't work as it is, and I am not good enough to spot the error... If someone could help me debug it, that would be awesome, though I don't mind a better or easier solution... <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script> <script type="text/javascript"> function checkForData() { jQuery.get('master_import.php?start=' + getElementById('starter').value,false,function(data){ if(data >= getElementById('starter').value){ document.getElementById('starter').value = data; document.getElementById('my_response').innerHTML = "Processing records... (" + data + ")"; checkForData(data); }elseif(data == "done"){ document.getElementById('my_response').innerHTML = "Done!"; }else{ document.getElementById('my_response').innerHTML = "meh..."; } }); } $(document).ready(function() { $('#my_button').click(function() { document.getElementById('my_response').innerHTML = "loading..."; }); }); </script> this is the form parts: <span id="my_response"></span><br /><br /> Start from: <input type="text" name="starter" id="starter" style="width:45px"><br /> <input type="submit" name="my_button" id="my_button" value="import">
  2. Hello, I've been trying this for hours now, looking at different examples and trying to change them to work for me, but with no luck... This is what I am trying to do: I have a simple form with: - 1 input field, where I can enter a number - 1 Submit Button When I enter a number into the field and click submit, I want that number to be send to the php file that is in the ajax call, then the script will take that number and run a bunch of queries and then return a new number. I want that new number to be used to call the php script via ajax again, until no number is returned, or something else is returned like the word "done" or something like that, at which point is simply makes an alert or populated a div with a message... The point is, that depending on the number entered it could take up to an hour to complete ALL the queries, so I want the script that is called to only run a fixed amount of queries at a time and then return the number it is currently at (+1), so that it can continue with the next number when it is called again. I would like to use jquery, but could also be any other way, as long as I get this to work. I already have the php script completed that needs to be called by the ajax, it returns a single number when being called. Thank you, vb
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.