HTML IMG help needed

After moving my web site from iis 6 to iis 8.5 I have had the opportunity to check my pages and found a page not working image that.

One of my html pages has an error I found this by using the IE F12 developers test mode

 <img id="imgCaptcha" alt="Refresh" src="../GB/captcha.asp" ><br><a href="javascript:void(0)" onclick="RefreshImage('imgCaptcha')">Change Image</a> <BR>

REFRESHIMAGE IS UNDEFINED


Thoughts


Thanks in advance

Tom
LVL 23
Thomas GrassiSystems AdministratorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gplanaCommented:
Looks like there is a missing .js file. Check which .js files are included on your html page and check that this file is not on new server and then copy it from old server to new server.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Thomas GrassiSystems AdministratorAuthor Commented:
gplana

first thanks for the quick response

I checked the code and only one .js is being used and in the debugger it found it ok I believe it is ok

here is my code
<html>  
<head>  
<script type="text/javascript" src="../js/GA-TGCSNET.js"></script>
</head>  
  
<body bgcolor="black" text="aqua"> 

<div>
<form>
<input type="button" value="See Guestbook" onClick="window.location.href='guestbook2.asp'">
</form>
</div>
<FORM ACTION="../guestbook.asp" METHOD=post>   
Your name<br>   
<input type=text name=visitorsname size=25><br>   
Your email<br>    
<input type=text name=visitorsemail size=25><br>    
Your message<br>   
<textarea name=visitorsmessage rows=4 Cols=80>  
</textarea><BR>   
 <img id="imgCaptcha" alt="Refresh" src="../GB/captcha.asp" ><br><a href="javascript:void(0)" onclick="RefreshImage('imgCaptcha')">Change Image</a> <BR> 
<input type=text name=captchacode size=25><br>    
<BR> 
<INPUT TYPE=submit value="Post">   
</FORM>  
</body>  
</html>

Open in new window


If you go to my site www.tgcsnet.com    then on the main page select Guest Book you will see what I mean

Thanks
0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
if you go look in the file

http://www.tgcsnet.com/js/GA-TGCSNET.js

there is no function called RefreshImage(), that's why you're getting the error. You're either missing a file, or missing some JS code in the main file.

Are you sure this worked in the past? :)
0
Thomas GrassiSystems AdministratorAuthor Commented:
Big Monty

GS-TGCSNET.JS is only for Google Analytics

Yes it worked in the past on my old web server but not sure when it worked last.

I got this code originally from http://www.tipstricks.org/
just went there again and found in the sample they have this code

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="custom_aspnet_test" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" language="javascript">
        function RefreshImage(valImageId) {
            var objImage = document.getElementById(valImageId)
            if (objImage == undefined) {
                return;
            }
            var now = new Date();
            objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server" defaultbutton="btnSubmit">
    <div style="text-align: center; margin-top: 20px;">
        <asp:PlaceHolder ID="phTest" runat="server" Visible="true">
        <img src="captcha.ashx" id="imgCaptcha" />&nbsp;<a href="javascript:void(0);" onclick="RefreshImage('imgCaptcha');">Get a new challenge</a><br />
        Write the characters in the image above<br />
        <asp:TextBox ID="txtCaptcha" runat="server"></asp:TextBox><br />
        <asp:Button ID="btnSubmit" runat="server" Text="Submit" />
        </asp:PlaceHolder>
        <asp:PlaceHolder ID="phResult" runat="server" Visible="false">
            <p><asp:Label ID="lblResult" runat="server" Font-Bold="true"></asp:Label></p>
            <asp:Button ID="btnRetry" runat="server" Text="Take another test" />
        </asp:PlaceHolder>
    </div>
    </form>
</body>
</html>

Open in new window



I see the mini js script that has the refreshimage code
I now remember I was cleaning up all my html code pages and extracting the js code and creating a separate file for each script that way if I needed the code in another page I can just link to it.

So now I am going back to recode this js script.


Thanks
0
Thomas GrassiSystems AdministratorAuthor Commented:
Thanks Guys

Was missing the javascript code for Refreshimage.

created a refreshimage.js file now working now

In my code in the first posting is there a way to after the user click on the POST button to present a page that says Thank You for signing our guest book please come back soon.

Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.