Pajama-JS
Pajama-JS copied to clipboard
toMarkup error
Using browser.pajama.js, and trying to toMarkup an element gives back an error:
"TypeError: Cannot call method 'toMarkup' of undefined
at PjsElement.self.toMarkup (http://192.168.56.101:5000/vendor/pajama/browser.pajama.js:332:51)
at PjsElement.self.toMarkup (http://192.168.56.101:5000/vendor/pajama/browser.pajama.js:332:51)
at
This happens when running the example at http://www.pajamajs.com/serverside.html It appears to be trying to call "Hello World"._view.toMarkup() on line 331. Obviously, "Hello World" doesn't have a _view property.
I found some time to take a look at your issue, and I can't replicate it. The code on the website is also in this repo ready-to-go: https://github.com/theninj4/Pajama-JS/tree/master/demo/serverside
From the root of the project you can: node demo/serverside/server.js
and browse to http://localhost:8080/
to see the Hello World
.
Looking at your stack trace, it looks like you might have mixed up the browser.pajama.js
and node.pajama.js
libraries ;)