Jump to content

[SOLVED] Check previous function


jaymc

Recommended Posts

I have an ajax function which works like this

 

open_url('page_to_sript', 'div_id_to_send_value_result_to');

 

 

Works fine, however, I have this function

 

 

LINE 1: open_url('page.php', 'populate');

LINE 2: document.getElementById('div_row').innerHTML = '<textarea id="populate"></textarea>';

 

Again, this works. However, if the ajax reuqest takes 3 seconds to get the data, that textarea remains visible and blank

for 3 seconds

 

 

What can I do to say only process LINE 2 after open_url function has fully completed. I dont really want to add anything

into open_url function, if possible

Link to comment
https://forums.phpfreaks.com/topic/109551-solved-check-previous-function/
Share on other sites

change line1 and line2?

Thats the whole point, it will just move onto the next function before waiting until the previous has finished execution

 

If possible. this probably shouldn't be written until sessionstate==4

 

document.getElementById('div_row').innerHTML = '<textarea id="populate"></textarea>';

 

I really need a way to do this outside of my open_url function, as I use this so many times and dont really want go pile it up with code instances which apply for one bespoke feature of the site

 

I need it outside of the function as demonstrated in my first post, if its at all possible?

I cant put anything bespoke to one function I need in the ajax function as this is a globally used function

 

I need it to work as ive explained above, otherwise I am going to end up with x amount of statements in that function

 

Can this be done in the way Ive explained above?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.