小编get*_*way的帖子

当我在PHP中包含文件时,它给我一个空白屏幕?

我试图在页面顶部包含标题,但它给了我一个空白屏幕.当我删除它时,PHP文件运行并显示内容:

<?php
    include("header.php");
?>
Run Code Online (Sandbox Code Playgroud)

出了什么问题?

php screen include

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

显示mysql计数功能?

$query = "select count(*)
                      from relationships
                      where leader = 'user_id'";
            $result = mysql_query($query);
Run Code Online (Sandbox Code Playgroud)

我该如何显示计数?谢谢

php mysql function count

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

jQuery - 单击一个元素会触发另一个元素

我有这个jQuery的文件,但vote_up click handler一直相互冲突与vote_down click handler,当我点击它改变了vote_up元素vote_down元素:

jQuery脚本:

$(document).ready(function () {
    $("a.vote_up").click(function () {
        //get the id
        var the_id = this.id.split('_').pop();
        //the main ajax request
        $.ajax({
            type: "POST",
            data: "action=vote_up&id=" + the_id,
            url: "ajax/votes.php",
            success: function (msg) {
                $("span.vote_count#" + the_id).html(msg).fadeIn();
                $("#" + the_id + " img").attr("src", "img/uparrowActive.png");
            }
        });
    });
});
$(document).ready(function () {
    // the vote down function
    $("a.vote_down").click(function () {
        //get the id
        var vote_id = this.id.split('_').pop();
        //the main ajax request
        $.ajax({
            type: "POST",
            data: …
Run Code Online (Sandbox Code Playgroud)

html javascript jquery image

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

jquery问题?

我有几天这样的jquery问题,我对此很新,所以原谅我在这个问题上的愚蠢.谢谢 :))

HTML代码:

<ul class="statuses">
<li id="set_23" class="message">
  // this is meant to increase everytime you click the vote_up just like stackoverflow 
  <span class="vote_count">27</span>
  <a href="#" class="vote_up"><img src="img/uparrow.png" /></a>
  <a href="#" class="vote_down"><img src="img/downarrow.png" /></a>

 </li>

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

这是我的jquery代码:

$(document).ready(function() {
    $('#statuses').delegate('.vote_up', 'click', function() {
       //get the id
        var the_id = $(this).closest('.message').attr('id').split('_').pop();
        //the main ajax request
        $.ajax({
            type: "POST",
            data: "action=vote_up&id=" + the_id,
            url: "ajax/votes.php",
            success: function (msg) {
                  // fade in the new vote_count
                $(this).siblings("span.vote_count").html(msg).fadeIn();
                  // get the child <img> and …
Run Code Online (Sandbox Code Playgroud)

html javascript jquery image fadein

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

编写此边框css属性的最短方法是什么?

我有div称为"commentbox"

我想要边框solid颜色#ccc,但我想要正确的一面,而不是边界.

所以只有左边,顶部和底部的div应该用钻孔线覆盖.谢谢

html css border

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

在PHP中生成随机代码?

我知道这可能看起来很傻,但我想生成一个8个characetrs的随机代码,只使用php的数字或字母.我需要这个为每个注册的用户生成一个密码,谢谢

php random

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

使用jquery将数字增加1?

$('.fav').live('click', function(e){
    $(this).toggleClass('highlight');
    //increase the number by 1
Run Code Online (Sandbox Code Playgroud)

HTML:

<li class="fav light_gray_serif">5</li>
Run Code Online (Sandbox Code Playgroud)

我如何使用jquery每次点击它时增加li之间的数量?谢谢

javascript jquery

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

从派生列排序mysql行

我想从mysql数据库中检索行并按投票顺序排序:

votes_up + votes_down = votes
Run Code Online (Sandbox Code Playgroud)

表:

posts{id, post_text, votes_up, votes_down, date}
ORDER BY votes
Run Code Online (Sandbox Code Playgroud)

mysql sql-order-by

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

在jquery中更改元素的id?

我想在jquery中更改元素的id,即

$('.aiButton').click(function(){
            $('.aiButton').id('saveold');

<a class="aiButton" id="savenew" href="login.php"><span>Save</span></a></li>
Run Code Online (Sandbox Code Playgroud)

你知道我想从savenew中获取id,saveold这就是你如何做到这一点,我想这就是谢谢!!

javascript jquery

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

在javascript串联?

我想在javascript中连接两个字符串即

$('#bio').css('font-color', result.titlecolor);
Run Code Online (Sandbox Code Playgroud)

但我想在result.titlecolor ie之前放置字符#

 $('#bio').css('font-color','#' result.titlecolor);
Run Code Online (Sandbox Code Playgroud)

这是对还是错?谢谢

javascript jquery concatenation

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