Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8031257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:02:15+00:00 2026-06-05T01:02:15+00:00

I’m getting a JavaScript error whenever you click the title link; in essence this

  • 0

I’m getting a JavaScript error whenever you click the title link; in essence this line: document.write('<a href="javascript:myclick(' + (i) + ')">' + '[[Title]]' + '<\/a><br>');
It’s frustrating me in a major way since all other browsers except IE7/8 don’t have any issues. Yet, a majority of our visitors are using IE7/8.
The problem only occur in IE, little else, however when I debug it is a javascript error so far as I will tell.

Thanks..

Here’s the info:

IE8 Debugging:

Line: 1 
Error: Function expected 

myclick(3) 
Function expected JScript - window script block, line 1 character 1 

IE9 Debugging (in IE8 Mode):

myclick(7)
SCRIPT5007: The value of the property 'myclick' is null or undefined, not a Function object script block (4), line 1 character 1

This is Line 1:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><meta http-equiv="X-UA-Compatible" content="IE=edge" >

This is the full script code; Google Maps:

<script type="text/javascript">
  var MapCenter = new google.maps.LatLng(41.52369114627216,-90.57780953284453)
  var i = -1;
  var Lat=new Array();
  var Long=new Array();
  var MarkerTitle=new Array();
  var Display=new Array();
  var myclick = new Array();
  var gmarkers = new Array();
</script>

<script type="text/javascript">
  var i = i + 1;
  Lat[i] = [[Lat]];
  Long[i] = [[Long]];
  MarkerTitle[i] = '[[Title]]';
  Display[i] = '<table><tr><td><div style="color: #a41d21;font-size: 13px; font-weight: bold;">[[Title]]</div></td></tr><tr><td>[[Address]]<br />[[City]], [[State]] [[Zip]]</td></tr><tr><td>[[Phone]]</td></tr><tr><td><a href="mailto:[[Email]]">[[Email]]</a></td></tr><tr><td><a href="[[WebURL]]" target="_blank">[[WebURL]]</a></td></tr></table>';
</script>

<div id="LeftArea" style="width: 220px; float: left; border-bottom: 1px solid #dedede; padding: 5px 0 5px 0;">
  <div style="color: #a41d21;font-size: 13px; font-weight: bold;">
    <script type="text/javascript">
      document.write('<a href="javascript:myclick(' + (i) + ')">' + '[[Title]]' + '<\/a><br>');
    </script>
  </div>
  <div>
    [[Address]]<br />
    [[City]], [[State]] [[Zip]]
  </div>
</div>

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
  function initialize() {
    myclick = function myclick(i) {
      google.maps.event.trigger(gmarkers[i], "click");
    }

    var myOptions = {
      zoom: 12,
      center: MapCenter,
      zoomControl: true,
      zoomControlOptions: {
        position: google.maps.ControlPosition.TOP_RIGHT,
        style: google.maps.ZoomControlStyle.SMALL
      },
      mapTypeControl: true,
      mapTypeControlOptions: {
        style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
      },
      scaleControl: true,
      scaleControlOptions: {
        position: google.maps.ControlPosition.TOP_CENTER
      },
      mapTypeId: google.maps.MapTypeId.ROADMAP,
    };

    var map = new google.maps.Map(document.getElementById('map_canvas'),myOptions);

    for (var i = 0, length = 50; i < length; i++) {
      var latLng = new google.maps.LatLng(Lat[i],Long[i]); 
      var InfoWindow = new google.maps.InfoWindow();

      var marker = new google.maps.Marker({
        position: latLng,
        map: map,
        title: MarkerTitle[i],
        html: Display[i]
      });

      gmarkers[i] = marker;

      google.maps.event.addListener(marker, 'click', function () {
        InfoWindow.setContent(this.html);
        InfoWindow.open(map, this);
      });
    }

    google.maps.event.addListener(map, 'click', function() {
      InfoWindow.close();
    });
  }
  google.maps.event.addDomListener(window, 'load', initialize);
</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:02:18+00:00Added an answer on June 5, 2026 at 1:02 am

    I don’t think you need to include the function name in this variable definition:

    myclick = new function(i) {
          google.maps.event.trigger(gmarkers[i], "click");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I am trying to render a haml file in a javascript response like so:
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.