Beej
Posts: 0
Joined: Tue Jul 01, 2014 1:56 am

Javascript editor

I'm pretty happy with Appery's javascript editor, but have two questions.

  1. The code checker does not seem to like strict mode. Can't even use the Appery function:

    Image

    Do you recommend not using javascript strict?

  2. Is there a way to make the text indent two spaces instead of four (so I can see more horizontally)?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Javascript editor

Hello -

  1. Where do you use this code? I can't reproduce it.
  2. This is a standard indentation and you can't customise it.
Beej
Posts: 0
Joined: Tue Jul 01, 2014 1:56 am

Javascript editor

Sorry, warnings arise when strict is declared inside any function:

prefunction PrintMsg(type) {
'use strict';
if (type == 'error') {
Appery('lbl_msg').css('color', '#f55353');
} else {
Appery('lbl_msg').css('color', '#53f594');
}
}
/pre

Looks like the answer for now is to always use the function form, no matter where it's declared:

pre(function () {
'use strict';
}());
/pre

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Javascript editor

Hi Beej,

That's not a problem,

you can use

pre

self.Appery('lbl_msg').css('color', '#f55353');

/pre

instead of

pre

Appery('lbl_msg').css('color', '#f55353');

/pre

Regards.

Beej
Posts: 0
Joined: Tue Jul 01, 2014 1:56 am

Javascript editor

OK, got it, thanks.

Return to “Issues”