我试图在页面顶部包含标题,但它给了我一个空白屏幕.当我删除它时,PHP文件运行并显示内容:
<?php
include("header.php");
?>
Run Code Online (Sandbox Code Playgroud)
出了什么问题?
$query = "select count(*)
from relationships
where leader = 'user_id'";
$result = mysql_query($query);
Run Code Online (Sandbox Code Playgroud)
我该如何显示计数?谢谢
我有这个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) 我有几天这样的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) 我有div称为"commentbox"
我想要边框solid颜色#ccc,但我想要正确的一面,而不是边界.
所以只有左边,顶部和底部的div应该用钻孔线覆盖.谢谢
我知道这可能看起来很傻,但我想生成一个8个characetrs的随机代码,只使用php的数字或字母.我需要这个为每个注册的用户生成一个密码,谢谢
$('.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之间的数量?谢谢
我想从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) 我想在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中连接两个字符串即
$('#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)
这是对还是错?谢谢