Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

error:Object cannot be created in this context" code: "9


Reply


3 Posts   762 Views

Avatar
ss_freebie

Community Member, 6 Posts

4 July 2009 at 12:30pm

Hi guys,

I am very new to SS. Recently I want to create some elements like div on the front page from page.ss with plain js or prototype, I will encounter this error from LeftAndMain.js according to fire bug:

Object cannot be created in this context" code: "9 LeftAndMain.js line 882
(no name)()prototype.js (line 658)
these()prototype.js (line 196)
getTransport()prototype.js (line 659)
initialize("Security/ping", undefined)prototype.js (line 738)
create()prototype.js (line 25)
(no name)()

I know the LeftAndMain.js is system generated that I have not included it myself. However it is very annoying. So how can I get around this and be able to create elements myself such as dropdown menu, draggable div and etc ?
Many thanks in advance.

cheers,

Avatar
billd

Community Member, 1 Post

5 July 2009 at 11:43am

hei, i have the same issue too, any one got idea ?!
cheez :)

Avatar
ss_freebie

Community Member, 6 Posts

5 July 2009 at 12:40pm

i have included the following prototype library in page.php:

Requirements::javascript("jsparty/prototype.js");
Requirements::javascript("jsparty/prototype15.js");
Requirements::javascript("jsparty/prototype_improvements.js");
Requirements::javascript("jsparty/prototype-safe.js");

i can use prototype library on the front end without problems, but as soon as i add this line for scriptaculous:

Requirements::javascript("jsparty/scriptaculous/scriptaculous.js");

on the front end i got the same javascript error from fire bug as mentioned above:
Object cannot be created in this context" code: "9

have i done something wrong ? any advices ?

thanks