小编s_k*_*k_t的帖子

选中的复选框未在UI中更新

我有一个关于通过JS检查复选框的问题.当我通过JS检查复选框时,它似乎在程序中被检查但在UI中它没有更新.

如果有人有解决方案

<!DOCTYPE html> 
<html> 
    <head> 
    <title>Check</title> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
    <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
    <script>    
    function getCheckedValue()
    {
    return ((document.getElementById("rock").checked));

     }

    function setCheckedValue(toBeChecked){
        document.getElementById(toBeChecked).checked="checked";
        alert((document.getElementById(toBeChecked).checked))
        alert($('#'+toBeChecked).attr('checked'))
    }
    </script>
</head> 
<body> 
<div data-role="page">
    <div data-role="header">
            <h1>What kind/s of music do you listen to?</h1>
    </div><!-- /header -->
    <div data-role="content">   
        <input type="checkbox" class="music" name="music" id="rock" value="rock" >
        <label for="rock">Rock</label>
        <input type="button" value="Get" onclick="alert(getCheckedValue())">
        <input type="button" value="Set" onclick="setCheckedValue('rock') ">
    </div>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

html javascript checkbox jquery

9
推荐指数
2
解决办法
2万
查看次数

IE 10字体问题 - OpenType嵌入权限检查失败.权限必须是可安装的

我正在创建一个Web应用程序,并使用自定义字体和fontawesome.我收到以下错误CSS3114:@ font-face失败OpenType嵌入权限检查.权限必须是可安装的.305D82_3_0.ttf

CSS3114: @font-face failed OpenType embedding permission check. Permission must be Installable. 
glyphicons-halflings-regular.ttf
Run Code Online (Sandbox Code Playgroud)

我的CSS是

  @charset "UTF-8";



@font-face
    {
      font-family: 'c_regular';
      src: url("305D82_3_0.eot") format("embedded-opentype");
      src: url("305D82_3_0.eot?#iefix") format("embedded-opentype"), url("305D82_3_0.woff2") format("woff2"), url("305D82_3_0.woff") format("woff"), url("305D82_3_0.ttf") format("truetype");
      font-weight: normal;
      font-style: normal;
    }
    @font-face
    {
      font-family: 'e_bold';
      src: url("fsemeric-bold-webfont.eot") format("embedded-opentype");
      src: url("fsemeric-bold-webfont.eot?#iefix") format("embedded-opentype"), url("fsemeric-bold-webfont.woff2") format("woff2"), url("fsemeric-bold-webfont.woff") format("woff"), url("fsemeric-bold-webfont.ttf") format("truetype"), url("fsemeric-bold-webfont.svg#e_bold") format("svg");
      font-weight: normal;
      font-style: normal;
    }
Run Code Online (Sandbox Code Playgroud)

html css fonts internet-explorer font-face

8
推荐指数
1
解决办法
2390
查看次数

无法使用Jquery绑定视频事件

我正在使用视频标签并使用bind或live绑定它.在这两种情况下它都不起作用.Below是我的代码可能是我做错了什么并且无法捕获它.

            <video width="videoWidth"
            height="videoHeight"
            poster="../Poster/poster.png"
            id="videoId"
            controls="controls"
            muted="true"    
            seeking="true"
            paused="true"   >

            <source src="../video/trailer.mp4" type="video/mp4"/>               
            <source src="../video/trailer.ogv" type="video/ogv"/>
            <source src="../video/trailer.webm" type="video/webm"/>
                Your browser does not support the video tag.
            </video>
Run Code Online (Sandbox Code Playgroud)

这是用于绑定事件的JS文件包含.

$("#videoId").bind('ended',function() {
            alert("Entered");
        });
Run Code Online (Sandbox Code Playgroud)

UPDATE

我正在更新以前的JS,现在它正在为所有视频事件工作.现在我坚持错误事件,事件将基于事件代码触发.可能我写错了,但是错误事件不能正常工作.我是JS

$(document).ready(function(){
        $("#videoId").bind('play',function() {
            alert("Play");
        });

        $("#videoId").bind('canplay',function() {
            alert("Can Play");
        });

        $("#videoId").bind('empited',function() {
            alert("Empited");
        });

        $("#videoId").bind('ended',function() {
            alert("Ended");
        });

        $("#videoId").bind('loadstart',function() {
            alert("Load Start");
        });

        $("#videoId").bind('pause',function() {
            alert("Pause");
        });

        $("#videoId").bind('playing',function() {
            alert("Playing");
        });

        $("#videoId").bind('progress',function() {
            alert("Progress");
        });

        $("#videoId").bind('suspend',function() {
            alert("Suspend");
        });

        $("#videoId").bind('volumechange',function() {
            alert("Volume"); …
Run Code Online (Sandbox Code Playgroud)

html5 bind html5-video jquery-mobile

5
推荐指数
1
解决办法
7411
查看次数

如何使用文本框值过滤多个选择中的值

我有一个文本框和多个选择框.当我在文本框中写东西时,它将在多个选择中过滤该文本并仅显示匹配的值.

<!DOCTYPE html>
<html>

<body>
    <select id="uniqueCarNames" name="cars" multiple>
        <option value="volvo">Long Distance Travel</option>
        <option value="saab">Amazing </option>
        <option value="opel">Excellent Travelling</option>
        <option value="audi">I am rich</option>
    </select>
    <input type="text" id="filterMultipleSelection" />
</body>

</html>
Run Code Online (Sandbox Code Playgroud)

因此,如果我开始在输入框中书写,它将开始过滤选择框中的值.我想要使​​用选项标签的文本进行过滤.请指导.

javascript jquery html5 autocomplete drop-down-menu

3
推荐指数
1
解决办法
1551
查看次数

如何改变轻触式拨动开关的宽度?

我无法更改迷你版本的翻转切换开关的宽度,并且文本未全部显示.

如果它不是迷你,我可以使用添加到CSS的技术来改变宽度:

 .containing-element .ui-slider-switch { width: 7em }    
Run Code Online (Sandbox Code Playgroud)

然后将交换机包含在div中.

如果我设置data-mini ="true"则完全相同,并且切换变为迷你,但我无法改变宽度.

如果翻盖拨动开关是迷你型,我该如何改变宽度?

谢谢

jquery togglebutton jquery-mobile

2
推荐指数
1
解决办法
3742
查看次数

Javascript对象 - 无法访问包含' - '的键

可能重复:
如何引用带有连字符的javascript对象属性?

我有一个以下格式的Json:

var response1="{" +
                        "\"code\":\"200\"," +
                        "\"requestID\":\"1002\"," +
                        "\"body\":\"[{" +
                        "\\\"author\\\":\\\"sumit\\\"," +
                        "\\\"id\\\":\\\"ABX-002\\\"," +
                        "\\\"title\\\":\\\"How to make Android APK in 2 seconds :)\\\"" +
                        "}," +
                        "" +
                        "{" +
                        "\\\"author\\\":\\\"sumit\\\"," +
                        "\\\"id\\\":\\\"ABX-002\\\"," +
                        "\\\"title\\\":\\\"How to make Android APK in 2 seconds :)\\\"" +
                        "}," +
                        "{"+
                        "\\\"author\\\":\\\"sumit\\\"," +
                        "\\\"id\\\":\\\"ABX-002\\\"," +
                        "\\\"title\\\":\\\"How to make Android APK in 2 seconds :)\\\"" +
                        "}" +
                        "]\"," +
                        "\"headers\":{\"Server\":\"Apache-Coyote/1.1\"," +
                                    "\"Content-Type\":\"text/xml\"," +
                                    "\"Content-Length\":\"131\"," +
                                    "\"Date\":\"Thu, 06 Sep 2012 09:10:26 GMT\"" + …
Run Code Online (Sandbox Code Playgroud)

javascript jquery json

0
推荐指数
1
解决办法
130
查看次数