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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:49:40+00:00 2026-06-16T20:49:40+00:00

I’ve got the following KnockoutJS 2.0 code that works fine in all modern browsers,

  • 0

I’ve got the following KnockoutJS 2.0 code that works fine in all modern browsers, but fails on IE8.

Here’s the simplified code:

<table>
   <tr>
       <td data-bind="template: { foreach: fooItems, name: 'foo-template' }></td>
       <td data-bind="template: { foreach: barItems, name: 'foo-template' }></td>
   </tr>
</table>

<script id="foo-template" type="text/html">
   <div data-bind="click: SomeMethod">
       foobar
   </div>
</script>

<script type="text/javascript">

   var viewModel = {
       fooItems: ko.observableArray(),
       barItems: ko.observableArray(),
   }
   ko.applyBindings(viewModel);

</script>

This works fine on IE9, Chrome, Firefox.

However, on IE8, I get the following error:

“Unable to parse bindings. SomeMethod is undefined.”

Debugging this in IE8, I see the following information:

enter image description here

It’s about to throw the exception, and it’s coming during the rendering of the foo-template.

Notice that $data is undefined. That’s why SomeMethod is not resolving; it should exist on $data.SomeMethod, but $data is undefined.

Why is this failing on IE8?

  • 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-16T20:49:42+00:00Added an answer on June 16, 2026 at 8:49 pm

    I had the exact same problem and was quite disapointed to see that you solved your issue without knowing how.

    So, for the futur visitors, here is how I solved this :

    I had initialised the array used in a foreach with an hard-coded array, ending with a trailing coma.

    In your example, that would looks like this :

    viewModel.fooItems([
        {SomeMethod: function () {}},
        {SomeMethod: function () {}},   // <- here is the evil coma
    ]);
    

    When looking a little closer, ie8 evaluated this array as a 3 items array whose last item was undefined. Hence the undefined $data.

    Of course, having the same symptoms doesn’t mean your problem was the same, but if it can help anybody …

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a small JavaScript validation script that validates inputs based on Regex. I

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.