Compiling for iPad with javascript binding

Hi,
I’m trying to compile for the ipad a game programmed with the cocos2d-html5 javascript.
now in the folder “template” of cocos2d-html theres two cocos2d files: cocos2d.js and cocos2d-jsb.js. In order to compile for ipad I’m using the second one but when I try to run the game from Xcode with the ipad simulator the xcode console says:

cocos2d-jsb.js:58:TypeError: cc.TARGET_PLATFORM is undefined

the file is “as is” taken from the “template” folder so is TARGET_PLATFORM obsolete? should I use something else to have the same result?

P.S.
poster here because the cocos2d-jsb.js file is part of cocos2d-html5

Welcome to post it here, :slight_smile:

We have added this template file on last 2.1.4 version. So if you are using earlier version of Cocos2d-x than 2.1.4, it will notice you this warning.

Could you please check your cocos2d-x version? Thanks.

I’m using 2.2.0 and running into the same situation (TypeError: cc.TARGET_PLATFORM is undefined)

Luis Parravicini wrote:

I’m using 2.2.0 and running into the same situation (TypeError: cc.TARGET_PLATFORM is undefined)

Sorry, we forgot to add the platform define in JSB.

cc.TARGET_PLATFORM = {
    WINDOWS:0,
    LINUX:1,
    MACOS:2,
    ANDROID:3,
    IPHONE:4,
    IPAD:5,
    BLACKBERRY:6,
    NACL:7,
    EMSCRIPTEN:8,
    MOBILE_BROWSER:100,
    PC_BROWSER:101
};

It will be added on v2.2.1.