我在尝试从每一行中删除第一列时遇到问题.我有一个感觉,这是我对jquery的理解.
我尝试了以下内容.
$("table:eq(2) tr td:first").remove() // this only removed the first cell
$("table:eq(2) tr td:first").each.remove() // didn't notice a difference
Run Code Online (Sandbox Code Playgroud)
我做错了什么想法?
浏览Facebook API,我对正确的方法感到困惑.我希望用户跳过注册,或者如果他们使用Facebook登录则自动注册.因此,如果他们登录Facebook,我会收集他们的ID,电子邮件并在我的用户表中创建一条记录.
如果用户表中已存在id,则跳过自动注册并直接转到成员页面.这是我的代码到目前为止(摘自Facebook的PHP SDK示例).当我运行注册脚本时,页面显示为空白,我不会被重定向.
编辑:似乎在要求之后失败,如果我使用以下代码'test'永远不会被打印.
编辑:我正在使用Codeigniter,这个脚本是控制器的一部分,会导致问题的问题吗?
require 'http://localhost/facebook-php-sdk-6c82b3f/src/facebook.php';
echo "test";
Run Code Online (Sandbox Code Playgroud)
-
public function signup()
{
require 'http://localhost/facebook-php-sdk-6c82b3f/src/facebook.php';
// Create our Application instance (replace this with your appId and secret).
$facebook = new Facebook(array(
'appId' => 'xxxxxxxxxxxxxxx',
'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
));
// Get User ID
$user = $facebook->getUser();
// We may or may not have this data based on whether the user is logged in.
//
// If we have a $user id here, it means we know the user is …
Run Code Online (Sandbox Code Playgroud) 当我在选择器中有'1'时,我有以下HTML和JavaScript适用于第一组元素但是当我用'i'替换'1'时它不会将自身附加到任何元素.关于为什么这可能不起作用的任何想法?(该脚本用于添加每行的前3列并在第4行显示)
实时链接:http://jsfiddle.net/c5mPc/
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
for (i = 2; i <= 14; i++)
{
$("#Q19_LND_"+i).keyup(function(){
$("#autoSumRow_"+i).val(Number($("#Q19_LND_"+i).val()) + Number($("#Q19_CE_"+i).val()) + Number($("#Q19_SOLSD_"+i).val()));
});
$("#Q19_CE_"+i).keyup(function(){
$("#autoSumRow_"+i).val(Number($("#Q19_LND_"+i).val()) + Number($("#Q19_CE_"+i).val()) + Number($("#Q19_SOLSD_"+i).val()));
});
$("#Q19_SOLSD_"+i).keyup(function(){
$("#autoSumRow_"+i).val(Number($("#Q19_LND_"+i).val()) + Number($("#Q19_CE_"+i).val()) + Number($("#Q19_SOLSD_"+i).val()));
});
}
});
</script>
</head>
<body>
<table>
<tr>
<td><font face="arial" size="-1">Lap Roux-N-Y</font> </td>
<td align="center"><input tabindex="1" type="text" name="Q19_LND_1" size="3" value="" id="Q19_LND_1"></td>
<td align="center"><input tabindex="2" type="text" name="Q19_CE_1" size="3" value="" id="Q19_CE_1"></td>
<td align="center"><input tabindex="3" type="text" name="Q19_SOLSD_1" size="3" value="" id="Q19_SOLSD_1"></td>
<td align="center"><input tabindex="4" …
Run Code Online (Sandbox Code Playgroud)