DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Guides
  • Core
    • can-component
    • can-compute
    • can-connect
    • can-define
    • can-define/list/list
    • can-define/map/map
    • can-route
    • can-route-pushstate
    • can-set
    • can-stache
      • Pages
        • Magic Tag Types
        • Scope and Context
        • Expressions
        • Template Acquisition
        • Helpers
        • Live Binding
      • Methods
        • from
        • registerConverter
        • registerHelper
        • registerPartial
        • registerSimpleHelper
        • safeString
      • Tags
        • {{expression}}
        • {{{expression}}}
        • {{#expression}}
        • {{/expression}}
        • {{^expression}}
        • {{>key}}
        • {{!expression}}
        • {{else}}
      • Expressions
        • Bracket Expression
        • Call Expression
        • Hash Expression
        • Helper Expression
        • KeyLookup Expression
        • Literal Expression
      • Key Operators
        • @at
        • ~compute
        • ./current
        • ../parent
        • %special
        • this
        • *variable
        • key
      • Helpers
        • {{#if expression}}
        • {{#unless expression}}
        • {{#each expression}}
        • {{#with expression}}
        • {{log}}
        • {{#is expressions}}
        • {{#switch expression}}
        • {{#case expression}}
        • {{#default}}
        • {{joinBase expressions}}
      • Types
        • getterSetter
        • helper
        • helperOptions
        • renderer
        • sectionRenderer
        • simpleHelper
    • can-stache/helpers/route
    • can-stache-bindings
  • Ecosystem
  • Infrastructure
  • Legacy
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Core
  • /
  • can-stache
  • /
  • {{joinBase expressions}}
  • / On this page
    • {{joinBase expressions}}

      function
      • source

      {{joinBase [EXPRESSION...]}}

      Return an application-relative url for a resource.

      {{joinBase "hello/" name ".png"}}
      

      Parameters

      1. EXPRESSION {KeyLookup Expression|Call Expression}:

        Expression or key arguments that reference a value within the current or parent scope.

      The joinBase helper is used to create urls within your application for static resources, such as images. An example usage:

      {{joinBase "hello/" name ".png"}}
      

      Where name is a scope value, this might return http://example.com/app/hello/world.png if the application is http://example.com/app.

      The url to join with is determined by the following factors:

      • If attempting to load a relative url, such as {{joinBase "../foo.png"}} and using StealJS the template's address will be used as a reference to look up the location.
      • If the can.baseURL string is set, this will be used.
      • If the System.baseURL is set, this will be used.
      • Lastly we fall back to location.pathname.

      CanJS is part of DoneJS. Created and maintained by the core DoneJS team and Bitovi. Currently 3.0.0.