开发者

Uncaught ReferenceError: Lawnchair is not defined [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 10 years ago.

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: Lawnch开发者_StackOverflowair is not defined

What am I doing wrong?


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.


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜