Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.72 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Mustache.js - display key instead of value
  2. [{"interval":"2012-01-21",
  3.   "advertiser":"Advertisers 1",
  4.   "offer":"Life Insurance",
  5.   "cost_type":"CPA",
  6.   "revenue_type":"CPA",
  7.   ... etc ...
  8. }]
  9.        
  10. var a=[{"interval":"2012-01-21","advertiser":"Advertisers 1","offer":"Life Insurance","cost_type":"CPA","revenue_type":"CPA","url":"URL 1","src":"test_source","sub_1":"test_sub1","sub_2":"test_sub2","sub_3":"test_sub3","sub_4":"test_sub4","sub_5":"test_sub5","browser":"chrome","country":"US","clicks":"8","unique_clicks":"3","cost":"120.00","revenue":"120.00","conversions":"2","CR":"25.00","CPA":"240.00","CPC":"960.00","RPA":"240.00","RPC":"960.00"}]
  11. a=a[0];
  12. var keys=[];
  13. for(i in a)
  14.     if(a.hasOwnProperty(i))
  15.         keys.push(i);