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

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.30 KB  |  hits: 12  |  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. Assigning values to knockout observable dynamically determined by string name
  2. self.loadData = function (src, dest) {
  3.     //dest is 'param1', src is 'param2', both are stings
  4.     if (src == 'param1')
  5.        self.p1observable($('#' + dest).val());
  6.     else
  7.        self.p2observable($('#' + dest).val());
  8. }