Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 单选按钮不显示签入主干代码的状态_Javascript_Jquery_Html_Backbone.js_Marionette - Fatal编程技术网

Javascript 单选按钮不显示签入主干代码的状态

Javascript 单选按钮不显示签入主干代码的状态,javascript,jquery,html,backbone.js,marionette,Javascript,Jquery,Html,Backbone.js,Marionette,我正试图在浏览器中保持单选按钮的选中状态。。。 但是我在浏览器中看不到选中状态。。。 我使用的是主干木偶代码。。 当我在主干视图js中使用它时,它是一个bug吗。。 因为当我把它作为普通html使用时,我在fiidle中看不到这个bug。。 在下面提供我的代码 模板 <ul class="bullet-list Soccer-options"> <li><input type="radio" name="new-Soccer" value="Use new

我正试图在浏览器中保持单选按钮的选中状态。。。 但是我在浏览器中看不到选中状态。。。 我使用的是主干木偶代码。。 当我在主干视图js中使用它时,它是一个bug吗。。 因为当我把它作为普通html使用时,我在fiidle中看不到这个bug。。 在下面提供我的代码

模板

<ul class="bullet-list Soccer-options">
    <li><input type="radio" name="new-Soccer" value="Use new Soccer ">Use new Soccer</li>
    <li><input type="radio" name="existing-Soccer" value="Use existing Soccer">Use existing Soccer</li>
    <li><input type="radio" name="no-Soccer" value="Lorem ipsum dolor sit amet">Lorem ipsum dolor sit amet</li>
</ul>

**views**

 ui: {
            arrow: '.sports-carrousel__form-border-arrow',
            soccerOptions: 'input[name=soccer]'
        },

        events: {
            'click .sports-carrousel__form-close': 'closeForm',
            'change @ui.soccerOptions': 'togglesoccerOptions'
        },

toggleSoccerOptions: function(e) {
    var inputName = $(e.currentTarget).prop('name');
    debugger;

    switch(inputName) {
        case 'new-Soccer':
            this.isNewSoccer = true;
            this.isExistingSoccer = this.isNoSoccer = false;
            break;
        case 'existing-Soccer':
            this.isExistingSoccer = true;
            this.isNewSoccer = this.isNoSoccer = false;
            break;
        case 'no-Soccer':
            this.isNoSoccer = true;
            this.isExistingSoccer = this.isNewSoccer = false;
            break;
    }

    this.render();
},
  • 使用新足球
  • 使用现有的足球
  • Lorem ipsum dolor sit amet
**观点** 用户界面:{ 箭头:'.sports-carrousel_uForm-border-arrow', 足球选项:“输入[名称=足球]” }, 活动:{ “click.sports-carrousel_u_form-close”:“closeForm”, “change@ui.soccerOptions”:“togglesoccerOptions” }, 切换开关选项:功能(e){ var inputName=$(e.currentTarget).prop('name'); 调试器; 开关(输入名称){ “新足球”案例: this.isNewSoccer=true; this.isExistingSoccer=this.isNoSoccer=false; 打破 “现有足球”案例: this.isExistingSoccer=true; this.isNewSoccer=this.isNoSoccer=false; 打破 “没有足球”一案: this.isNoSoccer=true; this.isExistingSoccer=this.isNewSoccer=false; 打破 } 这个。render(); },
您将事件处理程序名称拼写为两种不同的方式

'togglesoccerOptions'
togglesoccerOptions

注意大写字母
S


如果电话根本没有发生,那么这就是一个可能的候选人。

@muistoshort:谢谢你的回复。.我只发布了相关代码…更新了我的代码…我猜可能涉及到一些木偶的东西,但我不知道任何木偶。