Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Same script different error in IE
Old 03-29-2009, 03:58 PM Same script different error in IE
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
Here is the same code as delivered to browser:
HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<script type="text/javascript"
    src="http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=A4n80DTV34GBP2hnFN5HjI9A9FlAUeOR2VCyqVNL6dJr2wt86R1aRUy59b2rTvXmGA">  
</script>
<script type="text/javascript"> 
<!--
var ReqStr;
var Rec=0;
 
function Initialize()
    {
        alert("Initialize");
 
var ClientID = new Array();
var StoreName = new Array();
var Address = new Array();
var City = new Array();
var ST = new Array();
var Zip = new Array();
var Phone = new Array();
var Ext = new Array();
var Cell = new Array();
var Manager = new Array();
var Notes = new Array();
 
ClientID[0] = '0'
StoreName[0] = 'Handy Foods #62'
Address[0] = '9108 Balm Riverview Rd.'
City[0] = 'Riverview'
ST[0] = 'FL'
Zip[0] = ''
Phone[0] = '(813) 678-7794'
Ext[0] = ''
Cell[0] = ''
Manager[0] = 'Joe'
Notes[0] = 'This is a test '
        SetValues();
    }
 
function SetValues()
    {
        alert("SetValues");
        document.getElementById("StoreName").value = StoreName[Rec];
        document.getElementById("Address").value = Address[Rec];
        document.getElementById("City").value = City[Rec];
        document.getElementById("ST").value = ST[Rec];
        document.getElementById("Zip").value = Zip[Rec];
        document.getElementById("Phone").value = Phone[Rec];
        document.getElementById("Ext").value = Ext[Rec];
        document.getElementById("Cell").value = Cell[Rec];
        document.getElementById("Manager").value = Manager[Rec];
        document.getElementById("Notes").value = Notes[Rec];
        GetMap();
    }
 
function GetMap()
    { 
        alert("GetMap");
        var Location =  document.getElementById("Address").value + " " + document.getElementById("City").value + "," + document.getElementById("ST").value;
        if(Location)
            {
                // Create a map object   
                var map = new YMap(document.getElementById('map'));   
 
                // Add map zoom (long) control   
                map.addZoomLong();   
 
                // Add the Pan Control   
                map.addPanControl();   
 
                // Add map type control   
                map.addTypeControl();
 
                //Add marker
                map.addMarker(Location);
 
 
                // Set map type to either of: YAHOO_MAP_SAT, YAHOO_MAP_HYB, YAHOO_MAP_REG   
                map.setMapType(YAHOO_MAP_REG);   
 
                // Display the map centered on a geocoded location   
                map.drawZoomAndCenter(Location, 3);
            }                
    }
-->
</script> 
<style type="text/css">  
#map{
    border: thin solid #aaaaaa;
    width: 300px;
    display: block;
    overflow: hidden;
    height: 300px;
} 
                .style1 {
    color: #FF0000;
    font-weight: bold;
    font-style: italic;
}
                #main {
}
                .style2 {
    font-size: large;
    font-weight: bold;
    font-style: italic;
}
                .style3 {color: #FFFFCC}
                #main #form {
    width: 0px;
    border-style: inset;
    text-align: center;
    background-attachment: fixed;
}
                .style4 {font-size: large}
                #main #controls {
    border-top-width: thin;
    border-right-width: thin;
    border-bottom-width: thin;
    border-left-width: thin;
    border-top-style: outset;
    border-right-style: outset;
    border-bottom-style: outset;
    border-left-style: outset;
    width: 0px;
}
body {
    background-repeat: repeat;
    background-image: url(../Images/logo.png);
}
.style6 {
    font-family: "Century Gothic";
    font-weight: bold;
    font-style: italic;
    font-size: xx-large;
}
.style8 {font-size: small}
</style> 
</head>
<body onLoad="Initialize()">
 
        <div id="main" align="center"><span class="style6">Hawks</span>
        <form name="Clients" action="">
        <p>&nbsp;</p>
        <p><span class="style2">Clients</span></p>
        <div id="form" align="center">
            <table border="0" cellspacing="1"  bgcolor="#00FFFF">
                <tr>
                    <td  nowrap colspan="2" align="left"><div align="left" class="style1">
                            <div align="center" class="style4">                                    <div class="style8"><strong> Last Visit: </strong>03/20/09</div>
                            </div>
                    </div></td>
                    <td rowspan="9"><div id="map" align="center"></div></td>
                </tr>
                <tr>
                    <td  nowrap align="left"><strong>Store Name: </strong></td>
                    <td  nowrap align="right"><div align="left">
                            <input size="32" type="text" id="StoreName" name="StoreName" value="">
                    </div></td>
                </tr>
                <tr>
                    <td nowrap align="left"><strong>Address:</strong></td>
                    <td nowrap align="right"><div align="left">
                            <input size="32" type="text" id="Address" name="Address" value="" onKeyup="GetMap()">
                    </div></td>
                </tr>
                <tr>
                    <td nowrap align="left"><strong>City:</strong></td>
                    <td align="right" nowrap><div align="left">
                            <input size="13" type="text" id="City" name="City" onKeyup="GetMap()" value="" maxlength="32">
                            <input size="1" type="text" id="ST" name="ST" maxlength="2" onKeyUp="GetMap()" value="">
                            <input size="5" type="text" id="Zip" name="Zip" value="">
                    </div></td>
                </tr>
                <tr>                        </tr>
                <tr>
                    <td nowrap align="left"><strong>Manager(s):</strong></td>
                    <td nowrap align="right"><div align="left">
                            <input size="32" type="text" id="Manager" name="Manager" value="">
                    </div></td>
                </tr>
                <tr>
                    <td nowrap align="left"><strong>Phone:</strong></td>
                    <td nowrap><div align="left">
                            <input size="14" type="text" id="Phone" name="Phone" value="">
                            <strong>Ext:</strong>
                        <input size="6" type="text" id="Ext" name="Ext" value="">
                    </div></td>
                </tr>
                <tr>
                    <td nowrap align="left"><strong>Cell / Other:</strong></td>
                    <td nowrap><div align="left">
                            <input size="32" type="text" id="Cell" name="Cell" value="">
                    </div></td>
                </tr>
                <tr>
                    <td colspan="2" align="left" nowrap><div align="center"><strong>Notes:</strong>
                    </div>
                        <div align="center">                                    
                            <textarea id="Notes" name="Notes" rows="3" cols="32"></textarea>
                    </div></td>
                </tr>
            </table>
        </div>
        <div id="Message"></div>
        <div align="center">
        <div id="controls">
            <table border="1" cellpadding="2" cellspacing="3">
                <td nowrap height="39" bgcolor="#00FF00">
                            <input title="First Record" type="button" value="|<" name="First" onClick="Handler(this.name,''">
                            <input title="Previous Record" type="button" value="<" name="Previous" onClick="Handler(this.name,'')">
                            <input title="Next Record" type="button" value=">" name="Next" onClick="Handler(this.name,'')">
                            <input title="Last Record" type="button" value=">|" name="Last" onClick="Handler(this.name,'')">        </td>
                <td nowrap bgcolor="#00FF00">
                            <input title="New Record" type="button" value="*" name="New" onClick="Handler(this.name,'')">
                            <input title="Sort by current field" type="button" value="!" id="Sort" name="Sort" onClick="Handler(this.name,'')">        </td>
                <td nowrap bgcolor="#FF0000" class="style3">
                            <input title="Save Record" type="button" value="Save" name="Save" onClick="Handler(this.name,'')">
                            <input title="Delete Record" type="button" value="Delete" name="Delete" onClick="Handler(this.name,'')">        </td>
                <td nowrap bgcolor="#CCCCCC" class="style3">
                            <input title="Return to Main Menu" type="button" value="Done" name="Done" onClick="Handler(this.name,'')">
                            <input title="Clear Form" type="button" value="Clear" name="Clear" onClick="Handler(this.name,'')">        </td>
            </table>
            </div>
         </div>
        </form>
</div>
</body>
</html>
The function SetValues() throws the error " 'StoreName' is undefined " . The page is loaded when error occurs, I can tell this because of the alerts in code which alert after the form is displayed.
__________________
Sleeping Troll, EMUSE, Mind Expansion...Truly serendipity!

Last edited by Sleeping Troll; 03-29-2009 at 04:01 PM..
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Same script different error in IE
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.32072 seconds with 12 queries