我有一个关于通过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) 我正在创建一个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) 我正在使用视频标签并使用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) 我有一个文本框和多个选择框.当我在文本框中写东西时,它将在多个选择中过滤该文本并仅显示匹配的值.
<!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)
因此,如果我开始在输入框中书写,它将开始过滤选择框中的值.我想要使用选项标签的文本进行过滤.请指导.
我无法更改迷你版本的翻转切换开关的宽度,并且文本未全部显示.
如果它不是迷你,我可以使用添加到CSS的技术来改变宽度:
.containing-element .ui-slider-switch { width: 7em }
Run Code Online (Sandbox Code Playgroud)
然后将交换机包含在div中.
如果我设置data-mini ="true"则完全相同,并且切换变为迷你,但我无法改变宽度.
如果翻盖拨动开关是迷你型,我该如何改变宽度?
谢谢
我有一个以下格式的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) jquery ×4
javascript ×3
html ×2
html5 ×2
autocomplete ×1
bind ×1
checkbox ×1
css ×1
font-face ×1
fonts ×1
html5-video ×1
json ×1
togglebutton ×1