Welcome to Porter JS

Reserved Elements

Data binding

Two way binding of dataStore/model
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>
Set to 99
How many bottles of beer?

HTTP Requests

All potential key/value

{
    "breadcrumbs": [],
    "callbacks": [],
    "errors": [],
    "html": {} or "" or [],
    "notifications": [],
    "redirect": "",
    "title": "",
}
            

{"breadcrumbs": []}

{"callbacks": []}

{"errors": []}

{"html": ""} or {"html": []} or {"html": {}}

HTML
 <div id="content"></div>
JSON

    {
        "html": "Hello, world."
    }
                    
Make request
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:

{"notifications": []}

{"redirect": []}

{"title": []}