index.csp:26Uncaught SyntaxError: Unexpected token

28 views
Skip to first unread message

crmcw

unread,
May 9, 2011, 10:31:21 PM5/9/11
to Enterprise Web Developer Community
I'm getting a "Uncaught SyntaxError: Unexpected token <" in the sample
code in Lesson 7, Menus and Lists. I cannot see where there's an
extra ">".

The CSP code is here:

<script type="text/javascript">

EWD.sencha.init=function() {EWD.sencha.widget.zewdSTindex46=new
Ext.List({id:"mainMenu",itemTpl:"{optionText}",scroll:true,store:zewdSTStoreindex46,listeners:
{}});EWD.sencha.addWidget('index','mainMenu');EWD.sencha.widget.zewdSTindex36=new
Ext.Panel({fullscreen:true,id:"zewdSTindex36",layout:"fit",scroll:"vertical",dockedItems:
[{dock:"top",title:"EWD Mobile",xtype:"toolbar",items:[]}],items:
[EWD.sencha.widget.zewdSTindex46]});}; </script>

<script type="text/javascript">

<script language="cache" runat="server">

[[[[[[[ ---- index.csp:26Uncaught SyntaxError: Unexpected token <
------ ]]]]]]]
d writeListData^%zewdST2("mainMenuOptions",sessid) </script>

EWD.sencha.loadListData(zewdSTStoreindex46,EWD.sencha.jsonData);EWD.sencha.loadCardPanel('index','zewdSTindex36');
</script>

<script type="text/javascript">

Ext.setup({

crmcw

unread,
May 9, 2011, 10:37:33 PM5/9/11
to Enterprise Web Developer Community
The offending line in the index.ewd is:

<st:list id="mainMenu" sessionName="mainMenuOptions" scroll="true">

rtweed

unread,
May 10, 2011, 2:38:32 AM5/10/11
to Enterprise Web Developer Community
Sounds like it's the list contents you're generating in the
writeListData - ie the contents of your mainMenuOptions session array
and how it's being converted into JSON.

Use the Chrome Developer Tools to examine what is being received - use
the Javascript Beautifier to clarify it (as described in the EWD
Mobile Tutorial). If you can't immediately see the problem, post the
output here and someone may be able to help.

crmcw

unread,
May 10, 2011, 9:34:16 AM5/10/11
to Enterprise Web Developer Community
Thanks Rob. I tried that and I cannot see where there's an extra
">". Perhaps it's really a different issue. Note that one script
tag is beautified to two lines. Could a CRLF have been accidentally
inserted?
< script language = "cache"
runat = "server" >


here's the beautified code:

<script type="text/javascript">
EWD.sencha.init = function() {
EWD.sencha.widget.zewdSTindex44 = new Ext.List({
id: "mainMenu",
itemTpl: "{optionText}",
scroll: true,
store: zewdSTStoreindex44,
listeners: {}
});
EWD.sencha.addWidget('index', 'mainMenu');
EWD.sencha.widget.zewdSTindex36 = new Ext.Panel({
fullscreen: true,
id: "zewdSTindex36",
layout: "fit",
dockedItems: [{
dock: "top",
title: "EWD Mobile",
xtype: "toolbar",
items: []
}],
items: [EWD.sencha.widget.zewdSTindex44]
});
};
</script>
<script type="text/javascript">
< script language = "cache"
runat = "server" >

[[[[[[ ---- index.csp: 26Uncaught SyntaxError: Unexpected token <
d --- ]]]]
writeListData ^ % zewdST2("mainMenuOptions", sessid)
</script>
EWD.sencha.loadListData(zewdSTStoreindex44,EWD.sencha.jsonData);EWD.sencha.loadCardPanel('index','zewdSTindex36');
</script>


I'm using Cache and an object:

<ewd:config isFirstPage="true" cachePage="false"
prePageScript="##class(MyStuff.Test).getMainMenu">

Class MyStuff.Test [ Abstract ]
{
ClassMethod getMainMenu(sessid As %String) As %String
{
s list(1, "optionText")="hello world"
s list(2, "optionText")="ex 2"
s list(3, "optionText")="ex 3"
d saveListToSession^%zewdSTAPI(.list, "mainMenuOptions", sessid)
QUIT ""
Reply all
Reply to author
Forward
0 new messages