javascript - Execute multiple functions -


I have an object, InsertDB , which has many functions. I would like to execute one after another

only function 2 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 ();

You must implement the work so that they withdraw the promises, and then you can subscribe to those promises. JQuery or q.js.

Comments

Popular posts from this blog

c# - passing input text from view to contoller with FacebookContext using Facebook app -

ios - Does Core Data autoupdate a many to many relationship on saving -

Calling a C++ function from C# by passing a string with variable size to it -