Skip to content

Uncaught TypeError: Object ("jan piet") OR ("henk willem") has no method 'replace' #211

@vdevos

Description

@vdevos

I'm getting a Uncaught TypeError when i'm trying to transform my JSON data with handlebars

Copy/paste a error log from my latest version Goolge Chrome console:

Uncaught TypeError: Object ("nummers nl") OR ("nummersnl") has no method 'replace'
Handlebars.Utils.escapeExpressionhandlebars.js:668
program1
(anonymous function)handlebars.js:1529
parser.tracehandlebars.js:61
(anonymous function)
(anonymous function)handlebars.js:1512
(anonymous function)handlebars.js:1483
GetStuff.$.getJSON.success.complete.Stuff.page.js:264
f.extend._Deferred.e.resolveWithjquery-1.6.4.min.js:2
wjquery-1.6.4.min.js:4
f.support.ajax.f.ajaxTransport.send.d

It occurs on line:668 of the Handlebars.js file on the line:

return string.replace(badChars, escapeChar);

This is my Javascript code:

var source = $('div#template-name').html();
var template = Handlebars.compile(source);
var result = template(data);
$('div#target').html(result);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions