Welcome to Porter JS
Reserved Elements
#breadcrumbs
#content
Data binding
HTML
<a onclick="p.stack.set('beer', 99)">Set to 99</a>
<input type="number" data-bind="beer"><br>
How many bottles of beer? <span data-model="beer"></span>
HTTP Requests
{
"breadcrumbs": [],
"callbacks": [],
"errors": [],
"html": {} or "" or [],
"notifications": [],
"redirect": "",
"title": "",
}
{"breadcrumbs": []}
{"callbacks": []}
{"errors": []}
{"html": ""}
or {"html": []}
or {"html": {}}
HTML
<div>
<strong>Foo:</strong> <span id="foo"></span>
</div>
JSON
{
"html": {
"foo": "bar"
}
}
Make request
Foo:
HTML
<div>
<strong>Spam:</strong> <span id="spam"></span>
</div>
JSON
{
"html": [
{
"id": "spam",
"content": "eggs"
}
]
}
Make request
Spam: