我正在使用jQuery hoverIntent.js脚本来创建一个巨大的下拉菜单系统,该系统的灵感来自Son Tonaka的大型下拉/ CSS和jQuery sohtanaka.com/web-design/mega-drop-downs-w-css-jquery.我的页面包含一个由第三方供应商插入的prototype.js脚本(这是一个加载属性搜索和潜在客户管理内容的房地产网站).它在标签之前加载到最后.我的菜单脚本和jQuery调用加载在标记的顶部.下面我已经包含了2个链接.第一个链接我已经注释掉对prototype.js的调用,菜单工作正常.第二个链接调用prototype.js,下拉列表不起作用.
工作下拉:http://www.myreoforeclosures.com/_menutestfromcode.html(prototype.js已注释掉)
不工作下拉:http://www.myreoforeclosures.com/_menutestfromcode2.html(与prototype.js一起工作)
我已经尝试了jQuery网站上建议的jQuery noConflict()解决方案的许多变体,但对于我的生活,我无法解决冲突.我已经将上述链接简化为CSS和HTML的基础知识来测试下拉列表.
请注意我正在使用Web 2.0/CSS/jQuery攀登陡峭的学习曲线,因为这是我第一次尝试使用这些工具设计网站(以前基于表格的网站).
任何有助于让jQuery和原型协同工作的帮助将不胜感激.我只能控制jQuery脚本,因此必须对jQuery进行任何解析.我对prototype.js没有任何控制权.
这是我的代码:
if (isset($_POST['addmonths'])){
if (!empty($_POST['months'])){
if (is_numeric($_POST['months'])){
$monthtoadd = $_POST['months'];
if ($monthstoadd == 0){
mysql_query("UPDATE users SET months='lifetime' WHERE username='$lookupuser'");
echo "Successfully set " . $lookupuser . " to lifetime" . $monthstoadd;
}elseif ($monthstoadd > 0){
$monthstoadd = $monthstoadd*2592000;
mysql_query("UPDATE users SET months=months+'$monthstoadd' WHERE username='$lookupuser'");
echo "Successfully added " . $monthstoadd . " months to " . $lookupuser . "'s paid time.";
}else{
echo "Error.";
}
}else{
echo "Months need to be numeric. If you're trying to set lifetime, use …Run Code Online (Sandbox Code Playgroud) 我有很多像这样的代码:
FileStream fs = File.Open(@"C:\Temp\SNB-RSS.xml", FileMode.Open);
using (XmlTextReader reader = new XmlTextReader(fs))
{
/* Some other code */
}
Run Code Online (Sandbox Code Playgroud)
这给了我以下代码分析警告:
CA2000 : Microsoft.Reliability : In method 'SF_Tester.Run()', object 'fs' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'fs' before all references to it are out of scope.
Run Code Online (Sandbox Code Playgroud)
如果我按照建议操作并将File.Open放在using语句中,我会得到:
CA2202 : Microsoft.Usage : Object 'fs' can be disposed more than once in method 'SF_Tester.Run()'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time …Run Code Online (Sandbox Code Playgroud) 我有这个错误:
解析错误:语法错误,第57行的/...../student.php中的意外$结束
注意:"student.php"中的行只有56行,所以错误出现在另外一行!
<?php
session_start();
if(!isset($_SESSION['user_login']))
include('login.php');
else
{?>
<a href=student.php?add=1>????? ????</a><br>
<a href=student.php?edit=1>????? ?????? ????</a><br>
<?php
if($_GET['add'] ==1)
{?>
<form action="student.php?add=2" method="POST">
<input type="text" name="name" size="25" maxlength="50"> ??? ??????:
<br>
<input type="text" name="birthday" size="25" maxlength="50"> ????? ???????:
<br>
<input type="text" name="phone" size="25" maxlength="50"> ??? ??????:
<br>
<input type="text" name="mobile" size="25" maxlength="50"> ??? ?????? ??????:
<br>
<input type="text" name="email" size="25" maxlength="50"> ?????? ??????????:
<br>
<input type="text" name="comment" size="25" maxlength="100"> ???????:
<br>
<input type="submit" value="???">
<input type="reset" value="???">
</form>
<?php
} …Run Code Online (Sandbox Code Playgroud) 据我所知,out参数的唯一用途是调用者可以从单个方法调用中获取多个返回值.但我们也可以使用ref参数获取多个结果值!
那么有没有其他情况下out参数可以证明是有用的,而我们不能使用ref参数呢?
谢谢.
如何获得自定义UIVIew的x,y坐标?
NSLog(@"landscape orientation and myUIView.x==%f and myUIView.y==%f",myUIView.position.x ,myUIView.position.y )
Run Code Online (Sandbox Code Playgroud)
我收到以下错误
request for member 'position' in something not a structure or union
Run Code Online (Sandbox Code Playgroud) 我有遇到一些麻烦最近onSaveInstanceState()和onRestoreInstanceState().我有多个活动使用这些方法来保存状态,以防系统清理它们.他们中的大多数都工作,除了一个,我不知道为什么.
具体发生的是:
destroy()不再可见时的所有活动.(这样我就可以证明保存/恢复正常工作.) 我注意到onSaveInstanceState()被调用,onCreate()被调用,但是有一个空包,onRestoreInstanceState()永远不会被调用.
谁看过这个吗?
我的C程序有很多strstr函数调用.标准库strstr已经很快但在我的情况下搜索字符串总是长度为5个字符.我用特殊版本替换它以获得一些速度:
int strstr5(const char *cs, const char *ct)
{
while (cs[4]) {
if (cs[0] == ct[0] && cs[1] == ct[1] && cs[2] == ct[2] && cs[3] == ct[3] && cs[4] == ct[4])
return 1;
cs++;
}
return 0;
}
该函数返回一个整数,因为它足以知道ct中是否出现ct.在这种特殊情况下,我的功能比标准的strstr简单快捷,但我很想知道是否有人可以应用一些性能改进.即使是小改进也是受欢迎的
摘要:
编辑:感谢您的所有答案和评论.我必须研究和测试想法,看看什么是最好的.我将从MAK关于后缀trie的想法开始.
c# ×2
php ×2
android ×1
c ×1
ca2000 ×1
ca2202 ×1
conflict ×1
css ×1
dispose ×1
hoverintent ×1
jquery ×1
mysql ×1
objective-c ×1
performance ×1
prototypejs ×1
strstr ×1
uiview ×1
using ×1