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

2

if updateGridTitles is defined later you could simply add

var updateGridTitles; 

to the top

Fabrizio Calderan
  • 120,726
  • 26
  • 164
  • 177
  • 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
2

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
  • 914,110
  • 126
  • 1,211
  • 1,335
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
  • 893
  • 3
  • 8
  • 23