我的url是别人给的一个接口json类型的(这个也可以自己写 在JSONLint.com网站上可以解析)
data是一个对象(发送请求的参数传递)
succes后的function(a)参数a是根据url+指定data得到的一个新的对象 称为回调函数
data是一个对象(发送请求的参数传递)
succes后的function(a)参数a是根据url+指定data得到的一个新的对象 称为回调函数
2015-09-01
<script>
$(document).ready(function() {
$("a").click (function () {
if($("a").text() == "更多")
{
$("a").text("简化");
}
else
{
$("a").text("更多");
}
$("li:eq(0),li:eq(1)").toggle();
});
})
</script>
$(document).ready(function() {
$("a").click (function () {
if($("a").text() == "更多")
{
$("a").text("简化");
}
else
{
$("a").text("更多");
}
$("li:eq(0),li:eq(1)").toggle();
});
})
</script>
$(document).ready(function(){
$("a").click(function(){
var txt = $("a").html();
if("更多" == txt) {
$(this).html('简化');
$("li[class='hidden']").show();
} else if("简化" == txt) {
$(this).html('更多');
$("li[class='hidden']").hide();
}
});
})
$("a").click(function(){
var txt = $("a").html();
if("更多" == txt) {
$(this).html('简化');
$("li[class='hidden']").show();
} else if("简化" == txt) {
$(this).html('更多');
$("li[class='hidden']").hide();
}
});
})
<input type="file" value="file" /> 这个也行。。。
2015-08-31
<script type="text/javascript">
$(function() {
$("#left").bind("click",function(){
$(this).animate({left:"+=50px"},3000)})
$("#right").bind("click",function(){
$(this).animate({left:"-=50px"},3000)})
运行不了...看了好多别人写的代码,方块也都不动啊...不知道哪里错了
$(function() {
$("#left").bind("click",function(){
$(this).animate({left:"+=50px"},3000)})
$("#right").bind("click",function(){
$(this).animate({left:"-=50px"},3000)})
运行不了...看了好多别人写的代码,方块也都不动啊...不知道哪里错了
$("ul").toggle(1000,function(){
$spn.html() == "隐藏" ? $spn.html("显示") : $spn.html("隐藏");
})
$spn.html() == "隐藏" ? $spn.html("显示") : $spn.html("隐藏");
})
2015-08-31