Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

InnerHTML and Image Question

Status
Not open for further replies.

ISPrincess

Programmer
Feb 22, 2002
318
US
I have an asp page where in the Page_OnSubmit Function written in VBScript - I want to set the inner html of a Div tag that is already present on the page:

<Div align=center id='Patty' name='Patty'>
</Div>

The code to display an animated gif is as follows:
<SCRIPT LANGUAGE=&quot;VBScript&quot;>
Function Alert_OnSubmit

Patty.innerHTML = &quot;<img src=ani28t.gif><Font face=Fantacy color=DarkBlue><B> Processing...</B></Font>&quot;

end function
</Script>

All works fine when I run this on my local web server.

But when I run it on company web server (non-local)
The verbage &quot;Processing...&quot; appears correctly but the graphic does not.


I have determined:

- The gif is not corrupt
- The same thing happens on a non-animated gif
- Animated gifs appear correctly on the web server if not in 'innerhtml'
- happens in ie 5 and 6
- also happens when someone else uses my web server - in other words - it seems to happen when we are NOT running local

I have searched all over the web for an answer but to no avail. But from what I see, any postings where people are using img in innerhtml - they are also using java.

I do not know how to write my vb script function in java if that is the problem. Which I do not think it is.

Does anyone know what the problem may be?
Does anyone have any other debugging tips?

Help! (and thanks!)

 
It must be the file path is different on the server, than your local machine, that's about all it can be. Make sure it is in the same directory, and that you have uploade it at all!

This is a common issue when dealing with test and production servers.

<bb/>
 
It is in the same directory as all of my other pictures and as a matter of fact in the same directory as everything - asp pages and all.

Again, file is not corrupt.
 
Possibly ::
The image needs to be preloaded.
You are sending info to the server (form info) and
recieving the resulting page, while trying to access
the gif.

If not try this ::

<Div align=center id='Patty' name='Patty' style=&quot;visibility:hidden;position:absolute;&quot;><img src=ani28t.gif><Font face=Fantacy color=DarkBlue><B> Processing...</B></Font>
</Div>


<SCRIPT LANGUAGE=&quot;VBScript&quot;>
Function Alert_OnSubmit

Patty.style.visibility = &quot;visible&quot;;
Patty.style.position = &quot;relative&quot;;

end function
</Script>
 
Your code makes sense to me.

I tried it in my asp page locally and 'onsubmit' does not show the animation even locally now.

Again, I set the visibility to visible directly on the <Div> tag just to test and it works fine there - but not on the 'onsubmit'.

Also, I do not understand what you are saying here:

>>>Possibly ::
The image needs to be preloaded.
You are sending info to the server (form info) and
recieving the resulting page, while trying to access
the gif.<<<


PS Thank you for your patience

 
Check the readystate of the document before you insert it.

<bb/>
 
GIGN,

I am sure you are leading me down the correct path.

As a 'novice' to asp - do have any suggestions on books / articles / etc to help me with an overview of this type of thing.

These types of important concepts (readystate, etc) are where I am sorely lacking as a self-taught (self-teching) developer.

Thanks for all your help Gign and cfk!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top