br.request core functions

Accessible via global variable br.request

br.request.get(name, defaultValue)
  • name - name of GET parameter
  • defaultValue - optional default value

This function will return value of specified GET parameter or default value if specified

br.request.anchor()

This function will return value of anchor - portion of url after #

br.request.route(path, callback)
  • path - url string
  • callback - route handler

This function allow you to use basic routing in your scripts

Example:

br
  .request
    .route('/login.html', function() {
      // do handle login url
    })
    .route('/users.html', function() {
      // do handle users page
    })
;