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 7817309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:11:28+00:00 2026-06-02T06:11:28+00:00

I’m having a real problem with JavaScript scope in IE 9. This is inside

  • 0

I’m having a real problem with JavaScript scope in IE 9.

This is inside the body of my document (yes, I realize script should go in the head for proper HTML, but I’ve never had it break a script before). The script is in the body because I don’t want to mess with a shared header page for a script that is only relevant for this page:

<script type="text/javascript">
function googleMapsQuery(accountNum) {
    // function code is here (omitted for brevity)
}
</script>

This is inside a td block inside a tr block inside a tbody block inside a table block inside a form block inside the body:

<button id="google-422111" onclick="googleMapsQuery(422111)" type="button">Google This!</button>

I even moved the script block above the form just in case the order of the script function declaration was relevant (it’s not).

The script works flawlessly in FireFox and Chrome, but in IE 9 (with or without compatibility view on), I get this error:

SCRIPT5007: The value of the property ‘googleMapsQuery’ is null or undefined, not a Function object

I studied JavaScript scope, and I cannot figure out any reason why IE thinks that ‘googleMapsQuery’ is a property, and why it is undefined. It’s a function, and I defined it!

  • 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-02T06:11:30+00:00Added an answer on June 2, 2026 at 6:11 am

    I found the answer, and in spite of what I reported, it was NOT browser specific. The bug was in my function code, and would have occurred in any browser. It boils down to this. I had two lines in my code that were FireFox/FireBug specific. They used console.log. In IE, they threw an error, so I commented them out (or so I thought). I did a crappy job commenting them out, and broke the bracketing in my function.

    Original Code (with console.log in it):

    if (sxti.length <= 50) console.log('sxti=' + sxti);
    if (sxph.length <= 50) console.log('sxph=' + sxph);
    

    Broken Code (misplaced brackets inside comments):

    if (sxti.length <= 50) { //console.log('sxti=' + sxti); }
    if (sxph.length <= 50) { //console.log('sxph=' + sxph); }
    

    Fixed Code (fixed brackets outside comments):

    if (sxti.length <= 50) { }//console.log('sxti=' + sxti);
    if (sxph.length <= 50) { }//console.log('sxph=' + sxph);
    

    So, it was my own sloppy coding. The function really wasn’t defined, because a syntax error kept it from being closed.

    Oh well, live and learn. 😉

    • 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'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
I have this code to decode numeric html entities to the UTF8 equivalent character.
I am currently running into a problem where an element is coming back from
I am trying to render a haml file in a javascript response like so:
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string

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.