javascript - Execute multiple functions -
I have an object, only function 2 You must implement the work so that they withdraw the promises, and then you can subscribe to those promises. JQuery or q.js. InsertDB , which has many functions. I would like to execute one after another
InsertDB.addNot (); Function 1
InsertDB.addBk (); has finished looping, putting records, and so on. <7> Calling 7 function with the object lists each loop and indexed DB insertsDB = {ADBK: collects records in the function (if (object is hidden from the hypocopy ( "Books")) {for (var i = 0, j = object ["books"]. Length; i & lt; j; i ++) {server.books.add ({title: object ["books"] [I] .id, content: object ["books"] [i]});}}}, addNot: function {if (object ("host" property ("notification (For "var i = 0, j = object [" notification "]. Length; i & lt; j; i ++) {server.notifications.add ({content: item [" notifications "] [i]});}}} etc ... ... // On the event of Ajax success, do one thing after the other described above. Synchronize = {Start: function () {Return $ .ajax ({. ..... Success: Function (data) {var object = $ .resource (data); InsertDB.addBk (object); InsertDB.addNot (object); InsertDB.addUser (Object); InsertDB.addHistory (object); ect ...}}};
Synchornize.Start ();
Comments
Post a Comment