我一直在盯着我的代码几个小时,现在试图弄清楚为什么这个看似简单的jQuery游戏无效:
<!DOCTYPE HTML>
<html>
<head>
<title>title</title>
<meta charset="UTF-8">
<meta name="keywords" content="test">
<meta name="description" content="test">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p class='box' id='title'>"test"</p>
<div class='gallery'>
<p class='tNail' id='one'>
<p class='tNail' id='two'>
<p class='tNail' id='three'>
<div class='clear'></div>
<p class='tNail' id='four'>
<p class='tNail' id='five'>
<p class='tNail' id='six'>
<div class='clear'></div>
</div>
<div class='clear'></div>
<p class='footer'>test 2011 <a href='#'>test</a></p>
</body>
<script type="text/javascript" src="jquery.js"></script>
<script>
$(document).ready(function()
{
$(".tNail").click(function()
{
$(this).effect("scale", {percent:200, direction:'both'}, 1000);
});
});
</script>
</html>
Run Code Online (Sandbox Code Playgroud)
我尝试过使用noConflict()无济于事.如果有人能说出一些亮点,我将不胜感激.
谢谢.
这跟我提出的上一个问题有关:
我有一个定义Transaction类的DLL.它由WCF服务库和客户端应用程序引用.我收到错误声明服务库无法托管,因为它无法序列化DLL类.
这是服务代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using ServerLibrary.MarketService;
using SharedLibrary; // This is the DLL in question
namespace ServerLibrary
{
[ServiceContract]
public interface IService
{
[OperationContract]
string GetData(int value);
[OperationContract]
CompositeType GetDataUsingDataContract(CompositeType composite);
[OperationContract]
bool ProcessTransaction(SharedLibrary.Transaction transaction);
}
[DataContract]
public class CompositeType
{
bool boolValue = true;
string stringValue = "Hello ";
[DataMember]
public bool BoolValue
{
get { return boolValue; }
set { boolValue = value; }
}
[DataMember]
public …Run Code Online (Sandbox Code Playgroud) 我正在使用VS 2010数据生成器基于正则表达式生成测试字符串.
目前我在使用适当的模式生成HHMMSS时间字符串时遇到了困难.
到目前为止,我有这个,但它并不完全准确: ([01]?[0-9]|2[0-3])[0-5][0-9][0-5][0-9]
例如,一个期望的集合将是: 212013
我环顾四周,注意到有些人遇到了同样的问题,但他们的疏忽似乎并不适用于此.
我有一个PHP函数来将值数组添加到表中.它首先检查值是否为空,如果是,则替换它们NULL,以便null在表字段中放置.那我把每场null为允许null还放置一个0同去.
这是一些代码:
public static function AddGame($array, $tId)
{
global $db; // Bring DB into scope
// Get IDs from particular names
$locId = $array['fLocation'];
// Ensure empty values are SQL null
$hTeamId = "'{$array['fHomeTeam']}'";
$vTeamId = "'{$array['fVisitTeam']}'";
$hScore = "'{$array['fHomeScore']}'";
$vScore = "'{$array['fVisitScore']}'";
$hHoldFor = "'{$array['fHomeHoldFor']}'";
$vHoldFor = "'{$array['fVisitHoldFor']}'";
// Prepare row for insertion
$row = "'','$tId','$locId',$hTeamId,$vTeamId,'{$array['fDate']}','{$array['fTime']}',$hScore,$vScore,'{$array['fGameType']}',$hHoldFor,$vHoldFor";
$stmt = $db->prepare("INSERT INTO `game` VALUES($row)");
if($stmt->execute()) return true;
else return false; …Run Code Online (Sandbox Code Playgroud) 我已经读过该PDO::Prepare函数创建了一个安全的查询.这是否意味着转义字符不需要手动字面化?比如反斜杠字符.
我希望在视图中呈现部分视图,并且由于我使用强类型视图,因此我需要在主视图中包含两个视图模型。
这是我的视图模型,其中包含部分视图使用的模型和主视图使用的模型:
public class PersonIndexViewModel
{
public PersonLookupViewModel PersonLookupViewModel { get; set; }
public List<PersonViewModel> PersonViewModel { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
这是利用所有这些的视图:
@model ViewModels.PersonIndexViewModel
@{
ViewBag.Title = "Registered People";
}
<h2>@ViewBag.Title</h2>
<p>
@Html.ActionLink("Create New", "Create")
</p>
@Html.Partial("_LookupPartial", Model.PersonLookupViewModel);
<table>
<tr>
<th>
@Html.DisplayNameFor(m => m.PersonViewModel.personName)
</th>
<th>
@Html.DisplayNameFor(m => m.PersonViewModel.dob)
</th>
<th>
@Html.DisplayNameFor(m => m.PersonViewModel.address)
</th>
<th>
@Html.DisplayNameFor(m => m.PersonViewModel.internalNo)
</th>
</tr>
@foreach (var item in Model.PersonViewModel) {
<tr>
<td>
@Html.DisplayFor(i => i.PersonViewModel.personName)
</td>
<td>
@Html.DisplayFor(i => i.PersonViewModel.dob)
</td>
<td>
@Html.DisplayFor(i …Run Code Online (Sandbox Code Playgroud) 我在分布式系统中有三个程序,它们依赖于WCF服务进行通信.如果我在WCF服务库中使用了数据类型,如何从引用该服务的客户端访问它?
我能够从客户端控制台应用程序实例化WCF服务中定义的对象,尽管我无法用它做很多事情.我无法访问任何对象的成员方法或字段.
例如,我有这个在服务库和客户端中使用的Transaction对象类:
[DataContract]
public class Transaction
{
public int checkoutID;
public DateTime time;
public List<object> products;
public double totalPrice;
public bool complete;
[OperationBehavior]
public void Start(int ID)
{
checkoutID = ID;
products = new List<object>();
complete = false;
}
[OperationBehavior]
public void Complete()
{
time = DateTime.Now;
complete = true;
}
}
Run Code Online (Sandbox Code Playgroud)
这取自服务(IService)的接口文件,其中定义了另一个类,称为CompositeType.我错过了什么?我认为WCF服务允许远程处理方法和数据类型?
感谢任何可以提供帮助的人,我一直遇到WCF问题.
让两个表,一个持有用户信息,一个持有某种用户记录,比如收据.用户和收据之间存在一对多关系.
检索用户的最佳SQL方法是什么,按最大收据数排序?
我能想到的最好的方法是使用连接和计数(?)来返回用户数组及其相关收据的数量.
有没有办法在这个实例中使用count函数?
select * from `users` inner join `receipts` on `users`.`id` = `receipts`.`uId`
Run Code Online (Sandbox Code Playgroud) 似乎无法在任何地方找到这个问题.如何在LINQ表达式中使用OR运算符?
例如,遵循这个逻辑的东西:
var links = links.Where(l => l.First() == '/' OR.. == '//').ToList();
Run Code Online (Sandbox Code Playgroud) 在执行我的win表单应用程序时,我将获得一个跨线程异常似乎是一个随机的机会.以下是我试图管理它的方法:
private void ToOutput(string s)
{
if (!this.IsHandleCreated)
this.CreateHandle();
if (FormOutputArea.InvokeRequired)
{
FormOutputArea.Invoke(new Action(delegate ()
{
FormOutputArea.AppendText(s + Environment.NewLine);
}));
}
else
{
FormOutputArea.AppendText(s + Environment.NewLine);
}
}
Run Code Online (Sandbox Code Playgroud)
它似乎InvokeRequired并不总是准确的.我尝试BeginInvoke了相同的结果.
编辑:即使我检查IsHandleCreated并InvokeRequired使用断点,它们也设置为true,但else条件的分支仍然执行.
这是一个截图,显示现在抛出异常的位置:
