Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
Small suggestions from JSLint
Tags: jslint
07/12/2010
13:35
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Tony,

You made last time many changes in the code and I decide that it can be useful to verify the code with respect of JSLint. I used current code from the github.

Here are the summary of the corresponding suggestions:

In the file of grid.common.js. Lines 100-104

var parentZ = $(insertSelector).parents("*[role=dialog]").first().css("z-index")
if(parentZ)
    p.zIndex = parseInt(parentZ)+1
else
    p.zIndex = 950;

Should be modified to the following

var parentZ = $(insertSelector).parents("*[role=dialog]").first().css("z-index");
if(parentZ) {
    p.zIndex = parseInt(parentZ)+1;
} else {
    p.zIndex = 950;
}

(semicolon at the end of the first an the third lines and two {} blocks)

In the file grid.formedit.js the variable copydata defined in the line 353 will be never used. The variable with the same name are defined in the line 625 will be used only. In the same way variable opt defined in the line 1186 will be also never used. Probably in some lines after the line 1186 instead of opt variable are used another variable.

At the end the line 1357 of the file grid.base.js are missing semicolon(;)

In the line 1718 and 1731 are used empty blocks. One can eliminate the code in a simple way.

In the file grid.setcolumns.js in the line 54 are missed var vor i. Currently i will be global.

In the line 60 are missing semicolon.

In the line 91 the statement after the if(p.closeAfterSubmit) should be enclosed in block {}.

In the line 31-33 of the file grid.treegrid.js are used empfy block which could be better removed. In the line 45 if(rd[loaded] != undefined) should be better replaced with if(rd[loaded] !== undefined) or if(typedef(rd[loaded]) !== 'undefined')

In the lines 398 and 403 of the file jquery.fmatter.js the statement after 'if' should be placed in the block {}

In the file JsonXml.js one should in the lines 61, 71, 100, 239.

Best regards
Oleg 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
22 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information