function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
renuamirenuami 

help with backbone in visualforce

Folks

 

Hope someone can help me get my first backbone app working

 

below is the snippet of code that i have written in visualforce using backbone . unfortunately i dont see the output when i access te VF page. But for the same code i see the out put when i run it using regular html.

 

 Hello World text should be displayed when i run this. but no idea whats wrong with this code.

 

can someone advise?

 

<apex:page standardStylesheets="false" applyBodyTag="false" contentType="text/html" controller="ParsingJSON">
 
 <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
    <script src="http://ajax.cdnjs.com/ajax/libs/json2/20110223/json2.js"></script>
    <script src="http://ajax.cdnjs.com/ajax/libs/underscore.js/1.1.6/underscore-min.js"></script>
    <script src="http://ajax.cdnjs.com/ajax/libs/backbone.js/0.3.3/backbone-min.js"></script>

   <script  type="text/javascript">
  
    ListView = Backbone.Force.View.extend(
 
        {
 
            //el: $('body'),
 
            initialize: function( x )
 
            {
                //alert('My first Backbone');
                _.bindAll(this, 'render');
 
                this.render( x );
 
            },
 
            render: function( x )
 
            {
 
               //alert('My first Backbone');
 
                x.append("<ul> <li>hello world</li> </ul>");
 
                //el.append("<ul> <li>hello world</li> </ul>");
 
            }
 
        });
 
        var listView = new ListView($('#temp'));

    </script>
    </head>
 <body>
<div id="temp" style="color:#0000FF">
  <h3>This is a heading</h3>
  <p>This is a paragraph.</p>
</div>
 </body>
 
</apex:page>

 

renuamirenuami

Hello experts --- any advise????

Please help.