Clarification on $.get method used in Knockoutjs tutorial: Single Page Applications

76 views
Skip to first unread message

Karthik Murali

unread,
Jul 29, 2017, 5:43:38 PM7/29/17
to KnockoutJS
Hi all,

I have recently started to learn Knockoutjs from the tutorial section in the main site. In the 3rd chapter for SPAs (for a electronic mail box), I came across this to get data via Ajax.

$.get('/mail', { folder: folder }, self.chosenFolderData);

Could someone please advise what the 3rd parameter is? per JQuery documentation (https://api.jquery.com/jquery.get/), I am not clear to conclude if this is the callback function.

Thanks!

Michael Best

unread,
Jul 31, 2017, 2:26:16 PM7/31/17
to KnockoutJS
Yes, it's the callback function. Since Knockout observables are functions, sometimes it's possible to provide the observable itself as a callback.

Karthik Murali

unread,
Jul 31, 2017, 3:13:32 PM7/31/17
to KnockoutJS
Thanks! I was looking at the var itself (chosenFolderData).

Radek Wezyk

unread,
Feb 9, 2018, 12:52:08 AM2/9/18
to KnockoutJS
Hi Karthik,
I'm going through the same Knockout tutorial and I'd like to ask you if you tired to reproduce the functionality from the 3rd chapter for electronic mail box on your local machine. Specifically I'm about the code from '/mail' path.
If you could share some ideas I'd be grateful.
Thanks.
Reply all
Reply to author
Forward
0 new messages