You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
webapp.js is a mvc framework for web applications primarily using AJAX
4
+
MicroBoatWebapp.js is a javascript/jquery framework that makes it easier for developers to create interactive pages with the use of AJAX. It takes care of the AJAX requests with a zero javascript sollution. This way an front-end developer can put his energy on the HTML page and does not have to worry about coding in javascript.
5
+
6
+
The general idea is that you define an 'action' attribute inside a element you want to make interactive. The action attribute takes a URL which is used for the AJAX request.
7
+
8
+
Example:
9
+
10
+
<buttonaction="http://example.com/load/test.json">load some stuff inside the dom</button>
11
+
12
+
Then the ajax should return a result package in JSON, XML or HTML format. The JSON and XML contain a list of result actions used to manipulate the dom. This way the page can dynamicly be changed from the server side. When HTML is returned MicroBoatWebapp tries to replace the original triggering source.
13
+
14
+
Example:
15
+
16
+
->DOM before
17
+
<divid="target">replace my value</div>
18
+
<buttonaction="http://example.com/load/test.json">load some stuff inside the dom</button>
19
+
20
+
->Button triggered ajax response
21
+
{
22
+
"load":{
23
+
"query":"#target",
24
+
"html":"hello world"
25
+
}
26
+
}
27
+
28
+
->DOM after
29
+
<divid="target">hello worlde</div>
30
+
<buttonaction="http://example.com/load/test.json">load some stuff inside the dom</button>
31
+
32
+
This way it becomes relative easy to use AJAX.
33
+
34
+
Todo:
35
+
36
+
- support XML
37
+
- support one way query (so you can decide inside the action element where to load the response)
0 commit comments