Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7761511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:09:16+00:00 2026-06-01T14:09:16+00:00

template code <script type=text/template id=test-template> <section> <form id=<%= pid %>> <div class=row> <div class=span16>

  • 0

template code

<script type="text/template" id="test-template">
    <section>

        <form id="<%= pid %>">
            <div class="row">
                <div class="span16">
                    <p>
                        <input type="radio" checked name="text-align" id="" value="tal" />
                        <span>标题靠左</span>
                        <input type="radio" name="text-align" id="" value="tac" />
                        <span>标题居中</span>
                        <input type="radio" name="text-align" id="" value="tar" />
                        <span>标题靠右</span>
                    </p>
                </div>
            </div>

            <div class="row">
                <div class="span16">
                    <p><input type="text" name="title" class="span10" placeholder="标题" value="<%= title %>" /></p>
                    <p><textarea name="content" class="span14" placeholder="内容" rows="10"><%= content %></textarea></p>
                </div>
            </div>

            <div class="row">
                <div class="span8">
                    <p><input type="text" name="data-x" placeholder="X 轴" value="<%= data_x %>" /></p>
                    <p><input type="text" name="data-y" placeholder="Y 轴" value="<%= data_y %>" /></p>
                    <p><input type="text" name="data-z" placeholder="Z 轴" value="<%= data_z %>" /></p>
                </div>

                <div class="span8">
                    <p><input type="text" name="data-rotate-x" placeholder="X 轴旋转" value="<%= data_rotate_x %>" /></p>
                    <p><input type="text" name="data-rotate-y" placeholder="Y 轴旋转" value="<%= data_rotate_y %>" /></p>
                    <p><input type="text" name="data-rotate-z" placeholder="Z 轴旋转" value="<%= data_rotate_z %>" /></p>
                </div>
            </div>

            <div class="row">
                <div class="span8">
                    <p><input type="text" name="data-scale" placeholder="缩放" value="<%= data_scale %>" /></p>
                </div>

                <div class="span8">
                    <p><input type="text" name="data-rotate" placeholder="旋转" value="<%= data_rotate %>" /></p>
                </div>
            </div>

            <div class="row">
                <div class="span16">
                    <input type="hidden" value="<%= title_align %>" />
                    <input type="submit" class="btn" value="提交" />
                </div>
            </div>
        </form>
    </section>
</script>

(function($) {
window.Step = Backbone.Model.extend({});

window.Steps = Backbone.Collection.extend({
    model: Step,
    url: MyAjax.ajaxurl + "?action=query-homepage-step",
      initialize: function() {
        this.fetch();
      }
});

window.StepListView = Backbone.View.extend({
    el: $('#steplist'),
    initialize: function() {
        this.model.bind("reset", this.render, this);
    },
    render: function( eventName ) {
        _.each( this.model.models, function( step ) {
            $( this.el ).append( new StepView({ model: step }).render().el );
        }, this );
        return this;
    }
});

window.StepView = Backbone.View.extend({

    template: _.template( $('#test-template').html() ),
    initialize: function() {
        this.model.bind( 'change', this.render, this );
    },

    render: function( eventName ) {
        $( this.el ).html( this.template( this.model.toJSON() ) );
        return this;
    }
});

window. AppRouter = Backbone.Router.extend({
    routes: {
        "": "init"
    },

    init: function() {
        console.log('init');
        this.steps = new Steps();
        this.stepView = new StepView({ model: this.steps });
        this.steps.fetch();
    }
});
})(jQuery);

what’s wrong with it ?
i already make a template called $('#test-template') in page and pass all <%= var %> correctly?

Uncaught TypeError: Cannot call method 'replace' of null
b.templateunderscore-min.js:28
(anonymous function)stepmakerapp.js:27
(anonymous function)

sandbox is here http://zhanghong.sinaapp.com/make-homepage

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:09:18+00:00Added an answer on June 1, 2026 at 2:09 pm

    Change the include files from header to body… some thing like the below,

    <body>
    <script src="lib/jquery-1.7.1.min.js" type="text/javascript"></script> 
    <script src="lib/underscore-min.js" type="text/javascript"></script> 
    <script src="lib/backbone-min.js" type="text/javascript"></script> 
    </body>
    

    This works for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have follwing JSON: {mykey:[{name:Jak,interests:movies}]} and following opensocial app code: <script type=text/os-template require=mykey> <ul>
ExpressionEngine template code: <div class=container_16> <div class=grid_16> {if {segment_1} == home} {embed=include/title title=welcome} {if:elseif
In code: template<class T,int row, int col> void invert(T (&a)[row][col]) { T* columns =
The following template specialization code: template<typename T1, typename T2> void spec1() { } Test
I'm attempting to select all <script type=text/html> tags in a page. I use <script>
My header is calling a javascript file which sends out an email: <script type=text/javascript
I noticed that jquery's beta template plugin is using, the type attribute text/x-jquery-tmpl e.g
Can anybody tell me how to include commented code in emberjs handlebars templates? <script
Template code is not compiled until the template function is used. But where does
This is using the web app framework, not Django. The following template code is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.