<HTML>
<HEAD>
<title>Login</title>
<script type="text/javascript" src="http://script.auction.co.kr/common/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(":input[name='txtPassword']").blur(function(e){
$(this).css("background-color","white");
});
$(":input[name='txtPassword']").focus(function(e){
$(this).css("background-color","#FDFCDC");
});
$(":input[name='txtID']").blur(function(e){
$(this).css("background-color","white");
});
$(":input[name='txtID']").focus(function(e){
$(this).css("background-color","#FDFCDC");
});
});
</script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<div id="body">
<input type="text" id="txtID" name="txtID" CssClass="txt" Width="130px" tabIndex="1"></input>
<input type="password" id="txtPassword" name="txtPassword" Width="130px" TextMode="Password" tabIndex="2"></input>
</div>
</form>
</body>
Run Code Online (Sandbox Code Playgroud)
这是我写的代码.
在这段代码中,我感到非常不舒服,那是因为
两个TextBox几乎相同.
但是我无法缩短这段代码.
我认为必须有最佳代码.
我知道下面的代码工作相同.但我希望附加控件名称或ID.轻松阅读代码
$(":input").blur(function(e){
$(this).css("background-color","white");
});
$(":input").focus(function(e){
$(this).css("background-color","#FDFCDC");
});
Run Code Online (Sandbox Code Playgroud) class PubTools {
void update(Context context, {bool force: false}) {
// do something
}
}
Run Code Online (Sandbox Code Playgroud)
是旧代码.我想将函数名称更改update为upgrade.
Run Code Online (Sandbox Code Playgroud)class PubTools { @deprecated void update(Context context, {bool force: false}) { upgrade(context, force); } void upgrade(Context context, {bool force: false}) { // do something } }
但是dartanalyzer回复警告.
就像是..
[警告]预期1个位置参数,但找到2个(/ home/sungguk/program_store/lib/grinder _utils.dart,第130行,第8列)
如何删除警告?什么是正确的语法?
下面的代码无法捕获异常.
确实 catch 无法赶上其发生在该函数的异常?
try
{
Arche.Members.Feedback.FeedbackBiz_Tx a =
new Arche.Members.Feedback.FeedbackBiz_Tx();
a.AddFreeSubscriptionMember(
itemNo, buyerID, itemName,
DateTime.Today,DateTime.Today);
}
catch(Exception ex)
{
RegisterAlertScript(ex.Message);
}
Run Code Online (Sandbox Code Playgroud)
...
public void AddFreeSubscriptionMember(
string itemNo, string buyerID, string itemName,
DateTime fsStartDate, DateTime fsEndDate)
{
FeedbackBiz_NTx bizNTx = new FeedbackBiz_NTx();
if (bizNTx.ExistFreeSubscription(buyerID, itemNo))
{
throw new Exception("Exception.");
}
}
Run Code Online (Sandbox Code Playgroud) 如果我在div中写长文本,那么长文本会超过div墙.如何将其显示为多行?
我的测试代码如下
<html>
<body>
<div style="left: 700px; top: 150px; width: 400px; height: 360px; border:1px solid">1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud) 我正在写一个chrome扩展程序,它将自定义图像添加到网页。我希望用户将所有图像都放在“ backgrounds”文件夹中,并且我希望扩展程序能够检索extensions文件夹中“ backgrounds”目录中每个文件的文件名。在chrome扩展程序中似乎无法执行此操作。当我尝试使用chrome fileSystem API时,出现以下错误:
There were warnings when trying to install this extension:
'fileSystem' is only allowed for packaged apps, but this is a extension.
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?
javascript google-chrome google-chrome-extension google-chrome-app