connected
(the connection is up and
running), connecting
(disconnected and trying to open a
new connection), and waiting
(failed to connect and
waiting to try to reconnect).retry_time - (new Date()).getTime()
. This key will
be set only when status
is waiting
.
There are " + high_scoring.count() + " posts with " + "scores greater than 10
"; }); document.body.appendChild(frag); Unlike the other functions, `count` registers a dependency only on the number of matching documents. (Updates that just change or reorder the documents in the result set will not trigger a recomputation.) {{> api_box cursor_rewind}} The `forEach`, `map`, or `fetch` methods can only be called once on a cursor. To access the data in a cursor more than once, use `rewind` to reset the cursor. {{> api_box cursor_observe}} Establishes a *live query* that notifies callbacks on any change to the query result. `callbacks` may have the following functions as properties:We've always been at war with " + Session.get("enemy") + "
"; }); // Page will say "We've always been at war with Eastasia" document.body.append(frag); // Page will change to say "We've always been at war with Eurasia" Session.set("enemy", "Eurasia"); {{> api_box equals}} These two expressions do the same thing: (1) Session.get("key") === value (2) Session.equals("key", value) ... but the second one is always better. It triggers fewer invalidations (template redraws), making your program more efficient. Example: {{dstache}}! Show a dynamically updating list of items. Let the user click on an item to select it. The selected item is given a CSS class so it can be rendered differently. }} {{dstache}}#each posts}} {{dstache}}> post_item }} {{dstache}}/each}} {{! }}template>There are " + Users.find({online: true}).count() + " users online.
"; }); document.body.appendChild(frag); // Find all users that have been idle for a while, and mark them as // offline. The count on the screen will automatically update. Users.update({idleTime: {$gt: 30}}, {online: false}); // Show a counter, and let the user click to increase or decrease it. Session.set("counter", 0); var frag = Meteor.ui.render(function () { return 'click
"}}
Mouse click on any element, including a link, button, form control, or div.
Use `preventDefault()` to prevent a clicked link from being followed.
Some ways of activating an element from the keyboard also fire `click`.
{{/dtdd}}
{{#dtdd "dblclick
"}}
Double-click.
{{/dtdd}}
{{#dtdd "focus, blur
"}}
A text input field or other form control gains or loses focus. You
can make any element focusable by giving it a `tabindex` property.
Browsers differ on whether links, checkboxes, and radio buttons are
natively focusable. These events do not bubble.
{{/dtdd}}
{{#dtdd "change
"}}
A checkbox or radio button changes state. For text fields, use
`blur` or key events to respond to changes.
{{/dtdd}}
{{#dtdd "mouseenter, mouseleave
"}} The pointer enters or
leaves the bounds of an element. These events do not bubble.
{{/dtdd}}
{{#dtdd "mousedown, mouseup
"}}
The mouse button is newly down or up.
{{/dtdd}}
{{#dtdd "keydown, keypress, keyup
"}}
The user presses a keyboard key. `keypress` is most useful for
catching typing in text fields, while `keydown` and `keyup` can be
used for arrow keys or modifier keys.
{{/dtdd}}