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>



Thanks in advance

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.

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.

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:

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
<script type="text/javascript" src="../js/GA-TGCSNET.js"></script>
<body bgcolor="black" text="aqua"> 

<input type="button" value="See Guestbook" onClick="window.location.href='guestbook2.asp'">
<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>  
 <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>    
<INPUT TYPE=submit value="Post">   

Open in new window

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

Big MontyWeb Ninja at largeCommented:
if you go look in the file

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? :)
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
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" "">
<html xmlns="">
<head runat="server">
    <script type="text/javascript" language="javascript">
        function RefreshImage(valImageId) {
            var objImage = document.getElementById(valImageId)
            if (objImage == undefined) {
            var now = new Date();
            objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
    <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 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" />

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.

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.

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.