title: Dynamic template loading in Backbone JS
body: <p>In my current project, I am working with ROR, Backbone, Underscore JS and JQuery. In one of the view I set the JST template as follows</p>
  
  <pre><code>ABC.Views.BoardView = Backbone.View.extend({
  
      template : changeBoard,
  
      // el: '#boardHolder',
  
      events : {
          'click .count' : 'showPlaced',
          'click #newCard' : 'newCardForm',
          'click #showCardsOverview' : 'showCardsOverview'
      },
  </code></pre>
  
  <p>it continues...</p>
  
  <p>Also I have a function in the bottom of the page as follows</p>
  
  <pre><code>changeBoard: function(){
          var params = window.location.search.replace( "?", "" );
          var param= params.split("=");
          var boardSize = param[1];
          //return boardSize;
          if(boardSize === 4){
              'analysis/board44'
          }else{
              'analysis/board'
          }
      }
  </code></pre>
  
  <p>Why I wrote that function is to load different JST templates for taking the parameter from the URL. But this way is not working for me. It gives me the following error</p>
  
  <pre><code>ReferenceError: changeBoard is not defined
  [Break On This Error]   
  
  template : changeBoard,
  </code></pre>
  
  <p>Does anyone know how to load dynamic JST template by getting the URL parameters</p>
  
  <p>Thanks</p>