0

I have the following code:

/*jslint browser: true*/
/*global $, jQuery*/

if (json.RowKey !== json.NewRowKey) {
   $("#row_" + row).attr('data-rk', json.RowKey);
   updateGridMeta(entity, json.PartitionKey, json.NewRowKey, row, obj.table);
   updateGridTitles();
}

lint is reporting that updateGridTitles is used before it is defined. Is there a way to add something to the top of my script to tell it to not report this?

3 Answers3

1

if updateGridTitles is defined later you could simply add

var updateGridTitles; 

to the top

Fabrizio Calderan
  • 115,126
  • 25
  • 163
  • 167
  • updateGridTitles is defined in another file so I think it's something global. Can I define that in /*global ? –  Sep 25 '12 at 08:22
1

The same way as the other variables you are telling JSLint are global.

Add it to this list:

/*global $, jQuery*/

Such:

/*global $, jQuery, updateGridMeta */
Quentin
  • 857,932
  • 118
  • 1,152
  • 1,264
0

You can indeed tell jslint that a function is global. Have a look at their documentation here: http://www.jslint.com/lint.html#global and another question asked here: JSLint: was used before it was defined

Community
  • 1
  • 1
valanto
  • 883
  • 2
  • 8
  • 22