Re: Simultaneous post/get?
| From: | tedd | Date: | Sun, 11 Jun 2006 18:02:33 +0000 |
| Subject: | Re: Simultaneous post/get? | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-237766@lists.php.net to get a copy of this message | ||
At 5:46 PM +0100 6/11/06, Stut wrote:
>tedd wrote:
>>At 4:35 PM +0100 6/11/06, Stut wrote:
>>>The form, with onsubmit="return sndReq()". sndReq does the AJAX image thing
>>>(although I don't know why you're using AJAX here,
>>
>>I'm using ajax because it's a method to inject an image in a DOM div without
>>having to reload the current page.
>>
>>All I want to do is present an image during the "wait".
>>
>>Is there an easier way to do this?
>
>There is no need to hit the server for this. Simply include "display:
>none;" in the style for either the img tag or the div containing it so
>it's not shown when the page initially loads. In the onsubmit for the
>form change that display to 'block' to show the image. This also avoids
>the need to postpone posting the form since the image has already loaded.
>
>Image...
>
><img id="waitimg" src="/whatever.gif" style="display: none;"
>/>
>
>Form...
>
><form ... onsubmit="document.getElementById('waitimg').style.display =
>'block'; return true;">
Bingo!
That works slick ! While I *think* I know css, it would have taken me a long while before I would
have turned to css to solve this.
Your solution works much better than the convoluted code I was writing. It's clear that I need
to understand js better.
Thanks much Stut.
tedd
--
------------------------------------------------------------------------------------
http://sperling.com http://ancientstones.com http://earthstones.com