0

I'm trying to get the basic lawnchair example working.

The Code:

<script type="text/javscript" src="http://westcoastlogic.com/lawnchair/src/lawnchair.js"></script>

<script type="text/javascript">
    var people = new Lawnchair('people');
</script>

Gives the following error (in FF & Chrome consoles):

Uncaught ReferenceError: Lawnchair is not defined

What am I doing wrong?

BryanH
  • 5,826
  • 3
  • 34
  • 47
edt
  • 22,010
  • 30
  • 83
  • 118

3 Answers3

6

You misspelled "javascript" in the first <script> tag's "type" attribute. The browser therefore paid no attention to the file.

Many people, most of them attractive and popular, now recommend leaving off the "type" attribute entirely unless you explicitly want the browser to ignore the contents.

Pointy
  • 405,095
  • 59
  • 585
  • 614
  • 3
    Attractive and popular JS programmers? That's unpossible! – edt Jun 07 '11 at 05:40
  • There's a [campaign to clean up Stack Overflow](http://meta.stackexchange.com/q/167342/187073) by removing these typo-related questions - we could really use your help! Would you mind pitching in a little by casting a close vote on this question? – VisioN Feb 28 '13 at 20:27
1

Looks like you got a typo in the first script tag. 'text/javscript' = 'text/javascript

Chris
  • 1,040
  • 2
  • 14
  • 23
1

Actually that example is no longer valid as of the current build. Take a look at this check in. Require a callback in the Lawnchair constructor.

I'm still trying to get it straight myself but the constructor requires a callback in addition to the object passed in. I'll post what I got when its working.

Terrance
  • 11,764
  • 4
  • 54
  • 80
  • Cool, if you post the solution, I'll add it to the question as an update. – edt Jun 08 '11 at 04:12
  • were u able to get this to work?? – ghostCoder Jul 14 '11 at 07:20
  • what I ended up doing was using the version that was in the site tutorial on http://westcoastlogic.com/lawnchair/ – Terrance Jul 14 '11 at 13:21
  • That did work however it seemed like more than what was necessarily required for me. After dealing with that I decided to just use straight HTML5 local storage and parsing my converting my objects back and forth between json and string. – Terrance Jul 14 '11 at 13:32