It will work. Quotes are optional around object keys (only needed if 
there are spaces in the key).
So you can do {snippet: 4, year: year, type: charttype} which is the 
same as {'snippet': 4, 'year': year, 'type': charttype}

On 06/23/2013 06:01 PM, Eileen McNaughton wrote:
>
> In templates/CRM/Contribute/Page/DashBoard.js:
>
> > +  'use strict';
> > +
> > +  function getChart() {
> > +    var year, charttype, date, currentYear, chartUrl;
> > +    year        = $('#select_year').val();
> > +    charttype   = $('#chart_type').val();
> > +    date        = new Date();
> > +    currentYear = date.getFullYear();
> > +    if (!charttype) {
> > +      charttype = 'bvg';
> > +    }
> > +    if (!year) {
> > +      year = currentYear;
> > +    }
> > +    chartUrl = CRM.url("civicrm/ajax/chart", {snippet : 4});
> > +    chartUrl    += "&year=" + year + "&type=" + charttype;
>
> how should I use " - I notice in other examples it is {snippet : 4} 
> not {"snippet" : 4} but if I use {year : year} obviously that won't work
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/civicrm/civicrm-core/pull/1049/files#r4834965>.
>