有没有办法单独使用CSS动画单词中的每个字母?
我想可以使用javascript/jquery,将单词作为字母数组进行迭代.
但在这里,我正在寻找一个简单的方法..
使用名为filestyle的Jquery插件:http://www.appelsiini.net/projects/filestyle.我有一个id为adtype的选择框.如果所选选项的值为7,则会禁用ID为"adfile"的文件输入.
当用户已经选择了文件时,问题就变成了.我找不到清除文件输入然后禁用它的方法.$( '#adfile')VAL( '').不起作用.
JQUERY
$(function(){
$('#adtype').change(function(){
if($('#adtype option:selected').val()==="7"){
$('#adfile').val('');
$("#adfile").prop('disabled', true);
}else{
$("#adfile").prop('disabled', false);
}
});
});
Run Code Online (Sandbox Code Playgroud)
HTML
<form id="someform" action="somepage" method="post">
<select name="selectstuff" id="adtype">
<option value="1">one</option>
<option value="5">five</option>
<option value="7">seven</option>
</select>
<input type="file" id="adfile" value="" />
<input type="submit" value="submit" />
</form>
Run Code Online (Sandbox Code Playgroud) 我目前有两个PHP页面:test1.php和test2.php.里面的test1是2个DIV:一个名为"SubmitDiv",一个名为"DisplayDiv".在SubmitDiv内部是一个Submit按钮.当用户单击Submit按钮时,它应该在DisplayDiv中加载test2.php.目前test2.php只显示"Hello World".我希望它在DisplayDiv中加载test2.php,以便test1.php页面不需要打破步幅或以其他方式重新加载.
这就是我被困的地方.我知道我可能必须使用AJAX才能动态加载DisplayDiv中的test2.php页面.然而,如何做到这一点已经让我感到震惊,我迄今为止的尝试都失败了.使用下面的脚本,我从这个问题的在线搜索拼凑在一起,当我尝试点击提交按钮 - 它应该在DisplayDiv中加载test2.php - 而不是只刷新整个页面并且没有加载test2.php .
test1.php:
<html>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript">
function loadSubmitResults() {
$(function() {
$('#DisplayDiv').load('test2.php');
});
}
</script>
<body>
<div id="page">
<form id="SubmitForm" method="post">
<div id="SubmitDiv" style="background-color:black;">
<button type="submit" form="SubmitForm" onclick="loadSubmitResults();">Submit</button>
</div>
</form>
<div id="DisplayDiv" style="background-color:red;">
<!-- This is where test2.php should be inserted -->
</div>
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
test2.php:
<html>
<meta charset="utf-8">
<body>
<div id="page" style="background-color:yellow;">
<?php
echo "Hello World.";
?>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud) 我需要在随机字符串中替换和连接一些值,我将值存储在数组中.
即
$search = array('dog', 'tree', 'forest', 'grass');
$randomString = "A dog in a forest";
Run Code Online (Sandbox Code Playgroud)
如果一个或多个数组值与随机字符串匹配,那么我需要像这样的替换:
$replacedString = "A @dog in a @forest";
Run Code Online (Sandbox Code Playgroud)
有人能帮我吗?
谢谢.
我使用escapeshellarg从php传递到perl
system("perl -e '" . escapeshellarg($inp) . "' >> /tmp/out");
Run Code Online (Sandbox Code Playgroud)
并从perl获取未终止的引用字符串.
输入是: 'Single quoted terminated string\n';
我有一个用UTF8编码的NSstring.我想解码它.
我试过这个,但它不起作用:
NSString *decodedString = [NSString stringWithUTF8String:[encodedString cStringUsingEncoding:[NSString defaultCStringEncoding]]];
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?
谢谢