Tuesday, November 17, 2015

jquery nested json example

 shareNoteDocumentJson.push({
                    userId: '1',
                    notes: [
                        { noteId: 'n1', note: 'note1' },
                        { noteId: 'n2', note: 'note2' },
                        { noteId: 'n3', note: 'note3' },
                    ],
                    documents: [
                        { documentId: 'd1', document: 'document1' },
                        { documentId: 'd1', document: 'document2' },
                        { documentId: 'd1', document: 'document3' },
                    ]
                });

jquery check if radiobutton is checked

 if($('#radio_button').is(':checked')) { alert("it's checked"); }

Monday, November 16, 2015

jquery radio button checked event by name

  $('input:radio[name="share"]').change(function () {
                alert(this);
            });