Jump to content

replace text in div


robbster

Recommended Posts

I'm looking for some help and hopefully some can help...here's my dilemma.

I have a php script that I say when it's loaded to the browser,

it prints hello world, sleeps for say 3 seconds, and replaces that 'hello world' string

with 'bye'...

...kind of like the blinking 'processing' and when the php finishes whatever it is processing,

it replaces the blinking 'processing' with some other info.

 

Can anyone shine some light plz?

 

Thanks.

Link to comment
Share on other sites

<script language="">

function intialize()
{
document.getElementById('myDIV').innerHTML='Goodbye' // Echo PHP Where The Static "Goodbye" Currently Is
}
window.onload=function()
{
setTimeout("intialize()", 3000);
}
</script>

<span id="myDIV">Hello<!-- Echo Intial PHP Value Here Where Static "Hello" Currently Is --></span> World

Link to comment
Share on other sites

thanx phpQuestioner...truly appreciate it.

I guess I should really describe what I'm doing.

 

I have a php script that successfully uploads a file. It then processes it that takes about 3-10 seconds long.

After it finishes the processing, it displays links to what it processed.

My goal is to put some kind of a <blink>Processing</blink> before I start the processing and then replace it with the links.

 

Any ideas?

 

Thanks.

Link to comment
Share on other sites

 

Well what your wanting to do; using PHP Sleep() function; probably will not display any content in you page, until the sleep time is up. Why are you wanting to use the sleep function? You could do this with ajax; like when someone starts uploading a file; display text or an image in a html element (like a: span, div, or whatever) and then when your file loads; have you ajax to update the response text of that you would echo in your php page (once the file is uploaded); back to your html element. If you want it to blink; the easiest way is to use a animated gif - that is what I do.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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