我正在尝试使用jQuery 处理元素submit事件form.
$("form").bind("submit", function() {
alert("You are submitting!");
});
Run Code Online (Sandbox Code Playgroud)
当表单提交时(作为回发的一部分,例如当我点击按钮或链接按钮时),它永远不会触发.
有没有办法让这项工作?我可以附加触发提交的各个元素的事件,但这不太理想 - 有太多的可能性(例如具有autopostback = true的下拉列表,键盘快捷键等)
更新:这是一个最小的测试用例 - 这是我的aspx页面的全部内容:
<%@ page language="vb" autoeventwireup="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:scriptmanager id="ScriptManager" runat="server" enablepartialrendering="true">
<scripts>
<asp:scriptreference path="/Standard/Core/Javascript/Jquery.min.js" />
</scripts>
</asp:scriptmanager>
<p>
<asp:linkbutton id="TestButton" text="Click me!" runat="server" /></p>
</div>
</form>
<script type="text/javascript">
$(document).ready(function() {
alert("Document ready.");
$("form").submit(function() {
alert("Submit detected.");
});
});
</script>
</body> …Run Code Online (Sandbox Code Playgroud) 我正在开发一个项目,我们需要以XML格式保存数据.问题是,随着时间的推移,我们希望数据的格式/架构发生变化.我们希望能够生成脚本以跨不同的模式版本迁移我们的数据.我们将产品分发给成千上万的客户,因此我们需要能够在客户站点运行/应用这些脚本(因此我们不能手动进行转换).我认为我们正在寻找的是某种XML数据迁移工具.在我看来,理想的工具可以:
执行两个模式的"XML diff"以识别添加/删除/更改的节点.
允许我们指定转换函数.因此,例如,我们可能会向我们的架构添加一个新元素,该元素是旧元素的函数.(例如,新元素C,其中C = A + B,A + B是旧元素).
所以我认为我正在寻找一种XML差异和补丁工具,它也可以应用转换功能.我正在寻找的一个工具是Altova的MapForce.我相信其他人必须处理XML数据格式迁移.你是怎么处理的呢?
编辑:澄清一点.我计划做的"差异"是在架构或.xsd文件上.将对遵循给定模式的特定数据集进行实际更改.这些数据集将是.xml文件.因此它是模式的"差异",以帮助确定需要对数据集进行哪些更改以将它们从一个方案迁移到另一个方案.
我正在尝试修改Panel的控件,让它更新,然后继续执行代码.问题似乎是Panel在刷新之前正在等待空闲.我当然尝试刷新以及GetSizer().Layout()甚至使用SendSizeEvent()方法向帧发送resize事件,但无济于事.我在这里不知所措,我发现很难相信没有办法强制重新绘制这个面板.以下是更改控件的代码:
def HideButtons(self):
self.newButton.Show(False)
self.openButton.Show(False)
self.exitButton.Show(False)
self.buttonSizer.Detach(self.newButton)
self.buttonSizer.Detach(self.openButton)
self.buttonSizer.Detach(self.exitButton)
loadingLabel = wx.StaticText(self.splashImage, wx.ID_ANY, "Loading...", style=wx.ALIGN_LEFT)
loadingLabel.SetBackgroundColour(wx.WHITE)
self.buttonSizer.Add(loadingLabel)
self.GetSizer().Layout()
self.splashImage.Refresh()
Run Code Online (Sandbox Code Playgroud)
有没有人遇到过这样的事情?你是怎么解决的呢?
使用MVC和jQuery,我正在更多地使用CSS.想到的一个问题是使用Element ID与Classes的最佳方法是什么.如果我使用元素ID,jQuery中的选择器会更短.例如:
#imageTag... $('#imageTag')
#searchTag... $('#searchTag')
Run Code Online (Sandbox Code Playgroud)
作为替代方案,它可以使用父容器元素进行结构化.
#searchTool, #classifyTool .tag
Run Code Online (Sandbox Code Playgroud)
在这种情况下选择器如
$('#searchTool .tag')或$('#classifyTool .tag')
可用于.当整个页面中存在多个类的实例时,该方法尤其有用,例如.tag.您只需更改父容器对象即可.
这只是一个简单的理论示例,并不是为了代表真实的风格,只是描绘了这个概念.
所以有两个问题:
假设页面上有大量样式,是否对页面/ CSS或jQuery的性能有任何影响?
第二种方法似乎更灵活,更易于维护.根据您的经验思考.
有更好的替代方法吗?
谢谢
我想在文件的顶部和底部添加一行.我可以按照以下方式做到.
open (DATA, "</usr/old") || die "cant open old\n"; #file to which line has to be added
my @body=<DATA>;
close(DATA);
open (FILE, ">/usr/new") || die "cant open new\n"; #file after stuff has been added
print FILE "9 431";
print FILE "\n";
my $body=@body;
for (my $i=0; $i<$body;$i++){
print FILE "$body[$i]";#not using for loop leads to addition of spaces in new file
}
print FILE "(3,((((1,4),(7,6)),(2,8)),5),9)";
Run Code Online (Sandbox Code Playgroud)
由于我运行大量文件,因此这个过程非常耗时.Perl是否具有用于在文件顶部和底部添加行的任何特定功能?
在Windows上,subprocess.Popen.terminate调用win32 TerminalProcess.但是,我看到的行为是我尝试终止的进程的子进程仍在运行.这是为什么?如何确保进程启动的所有子进程都被终止?
我按照指示将Sonar与Maven集成 - 更改了settings.xml以包含声纳存储库:
http:// localhost:9000/deploy/maven
我已经验证我能够在以下位置看到readme.txt文件:
http://localhost:9000/deploy/maven/README.txt
但在运行时,sonar:sonar我不断收到以下消息:
[INFO] [sonar:sonar]
[INFO] Sonar host: http: //localhost:9000
[INFO] Sonar version: 1.7
Downloading: http: //localhost:9000/deploy/maven/org/codehaus/sonar/runtime/sonar
-core-maven-plugin/20090803213910/sonar-core-maven-plugin-20090803213910.pom
Downloading: http: //<MY SERVER URL>:8081/nexus/content/groups/public/org/codehaus/
sonar/runtime/sonar-core-maven-plugin/20090803213910/sonar-core-maven-plugin-200
90803213910.pom
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Can not execute Sonar
Embedded error: Unable to build project for plugin 'org.codehaus.sonar.runtime:s
onar-core-maven-plugin': POM 'org.codehaus.sonar.runtime:sonar-core-maven-plugin
' not found in repository: Unable to download the artifact from any repository
org.codehaus.sonar.runtime:sonar-core-maven-plugin:pom:20090803213910
Run Code Online (Sandbox Code Playgroud)
从指定的远程存储库:
声纳(http:// localhost:9000/deploy/maven),
nexus(http://:8081/nexus/content/groups/public),
for project org.codehaus.sonar.runtime:sonar-core-maven-plugin [INFO] ------------------------------ …
我不是Subversion的新手,但到目前为止我一直使用Tortoise而不是commadn系列.我的问题是,我如何忽略来自ENTIRE源的所有文件,如*.o,而不仅仅是根.
例如,如果我有以下文件:/myfile.o /folder1/myfile2.o /folder1/folder1.1/myfile3.o /folder2/myfile4.o
如果svn propedit svn:忽略"." 在根目录中,并添加*.o,它将忽略myfile.o,但不会忽略/folder1/myfile2.o,/folder1/folder1.1/myfile3.o,/folder2/myfile4.o.有没有办法为整个项目添加*.o(我无法为整个存储库执行此操作,我知道可以完成,因为此项目位于包含许多其他项目的存储库中)?
如果我需要澄清,请告诉我.谢谢!
在提到lib或包含提供功能库之前已经问过这个问题,但我想从头开始创建一个.所以关于以下的任何想法
质量要求
有任何想法吗?如果不能这样做,请告诉我:D
谢谢
jquery ×2
python ×2
asp.net ×1
css ×1
filehandle ×1
form-submit ×1
gallery ×1
html ×1
kill-process ×1
linux ×1
logging ×1
logrotate ×1
migration ×1
mysql ×1
panel ×1
perl ×1
php ×1
process ×1
refresh ×1
sonarqube ×1
subprocess ×1
svn ×1
tortoisesvn ×1
unix ×1
webforms ×1
windows ×1
wxpython ×1
xml ×1
xsd ×1