Loading ...
Sorry, an error occurred while loading the content.
 

Re: Unused variable Function Defined But Called By eval'd call

Expand Messages
  • Douglas Crockford
    ... That seems unlikely.
    Message 1 of 3 , May 21, 2011
      --- In jslint_com@yahoogroups.com, jamrsim@... wrote:
      >
      > I understand eval is evil, but unfortunately have to use it.

      That seems unlikely.
    • jamrsim@yahoo.com
      ... Thanks for the reply. I will presume you are correct and I need to figure out a way around my eval. However, in a similar vein, what is the best practice
      Message 2 of 3 , May 23, 2011
        --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...>
        wrote:
        >
        > --- In jslint_com@yahoogroups.com, jamrsim@ wrote:
        > >
        > > I understand eval is evil, but unfortunately have to use it.
        >
        > That seems unlikely.
        >

        Thanks for the reply.

        I will presume you are correct and I need to figure out a way around my
        eval.

        However, in a similar vein, what is the best practice for a pre-defined
        function (YUI Library) where my custom code does not use one of the
        defined parameters being passed to my function. This too, yields and
        unused variable message.

        Error: Unused variable: oColumn 127 'addWrench'

        formatter - String ||
        HTMLFunction
        Cell formatter function, or a shortcut pointer to a function in
        theDataTable.Formatter object. The function, called from the
        DataTable'sformatCell method, renders markup into the cell linerelement
        and accepts the following arguments:elLinerThe element to write
        innerHTML to.oRecordThe associated Record for the row.oColumnThe Column
        instance for the cell.oDataThe data value for the cell.
        For example:
        .
        .
        addWrench = function (el, oRecord, oColumn, oData) {
        el.innerHTML = oData;
        if (oRecord.getData('spacer') === 'OpenLabor') {
        el.innerHTML += ' <img src="/images/wrench.png" title="Tech
        currently clocked on the job">';
        }
        },
        .
        .
        // Datatable column definition
        dtCols = [
        {key: "field"},
        {key: "description", formatter: addWrench},
        .
        .

        Thanks Again!



        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.