Created
November 3, 2016 00:48
-
-
Save woosungchu/2755e8dfcbb2b9af5b62c2ba900d449c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data = $form.serializeArray(); | |
| console.log($jq.grep(data, function(e){ return e.name == 'apprTitle'; })); | |
| // Array[1]0: Objectname: "apprTitle"value: "untitled" | |
| //What I expect is empty value.... but it log 'untitled' | |
| //apprTitle catch null | |
| $jq.each(data, function(i,item){ | |
| if(item.name === 'apprTitle'){ | |
| if(item.value === '') item.value= 'untitled'; | |
| return false; | |
| } | |
| }); | |
| console.log($jq.grep(data, function(e){ return e.name == 'apprTitle'; })); | |
| // Array[1]0: Objectname: "apprTitle"value: "untitled" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment