Original Post
Dear Gamedev, javascript is by far one of the weirdest languages I've worked with. It's puppy dogs and lollipops on the outside and really easy to use when you want to do some simple things but the second start applying some intense structure to it the gremlins come out. My problem right now I'm making a map that has the ability to pan, and zoom. the problem is right now I'm adding a compass picture on top of the map and when it;s fully image mapped it should be able to be your buttons for panning. My problem is the map has been constructed in the Prototype classing so I can run multiple instances of it. because it's an instance and I'm placing direct HTML into a Div I need to be able to retrieve the name of the instance as a string so I can send it back to the div. Is there a way to retrieve the name of the current instance from within the instance in javascript without just directly passing a parameter that is a string on the name? <pre> MapWrapper.prototype.addOverlay= function(imgDiv) { that=this; GetMapDiv(imgDiv).innerHTML = "< I M G id= '" + that.mapID + "Compass' src='ZoomyThing.png' width='50' height='50' " + "usemap='#" + that.mapID + "CompassMap' />" + "<map id ='"+ that.mapID + "CompassMap' name='"+ that.mapID + "CompassMap'>" + "<area shape ='rect' coords ='7,0,13,13'" + " onclick='" + that+ ".Pan('W');' />"; } </pre>