placeholder

Why use `javascript:void(0)` instead of `javascript:` as an href do nothing placeholder? [duplicate]

若如初见. 提交于 2019-11-28 06:58:34
This question already has an answer here: href=“javascript:” vs. href=“javascript:void(0)” 8 answers I have seen href="javascript:void(0)" and I have seen href="javascript:;" Is there any reason I would not just use href="javascript:" instead? Edit: Let me make it clear: I am combining this with an onclick and have no objection to using return false if it becomes necessary to use the alternative. Of course this is only if the alternative makes better sense over javascript: . Also, I have yet to see a answer to my question shown (clearly I think) in the first paragraph. Thanks, david. :) I have

Placeholder CSS not being applied in IE 11

风流意气都作罢 提交于 2019-11-28 06:45:00
I am getting some problem in applying placeholder css. I am trying to apply css (i.e. color:#898F9C; ) on input-box placeholder using pseudo-class selector :-ms-input-placeholder , but it's not working in IE. Demo After some hit and try, I get solution of my problem, but it's amazing. If i removed the default css/style color on input-box, placeholder css working properly in IE(It's amazing behavior of Internet Explorer). My default css/style: #search { color:blue; } Working-fiddle without input-box default css My question is, why it's not working with default CSS in IE? David Storey Further to

css 修改placeholder字体颜色字体大小 修改input记住账号密码后的默认背景色

社会主义新天地 提交于 2019-11-28 06:38:56
壹 ❀ 引 本来这个阶段的项目页面都是给实习生妹子做的,我只用写写功能接接数据,但这两天妹子要忙翻译,这个工作阶段也快结束了导致有点慌,只能自己把剩余的几个小页面给写了。 那么做页面的过程中,UI也是精益求精提了部分小要求,例如希望修改input提示语(placeholder)字号颜色,再如浏览器会记住密码,导致input输入框自带了背景色,希望去除这个颜色。之前也没遇到过,或者说遇到也记不住代码,所以趁此机会记录下。 贰 ❀ 修改placeholder字号颜色 placeholder字体大小默认继承input字体大小,当然有时候我们希望提示语句与input输入问题字体大小不同,其次,placeholder背景色与字体颜色不会继承input,所以得额外设置,我们可以通过如下代码设置,例如修改前后: input::-webkit-input-placeholder { /* 修改字体颜色 */ color: #fff; /* 修改字号,默认继承input */ font-size: 12px; /* 设置背景色 */ background: #8ac6d1; } 叁 ❀ 修改input记住账号密码的背景色 浏览器有时候会自动帮助我们记住账号密码,然后记住之后,input就被动的添加了一个淡蓝色,UI表示看着很不舒服,希望不要有颜色,如下图: 然后查了下,目前有两种解决方案: 1

how to find control in ItemTemplate of the ListView from code behind of the usercontrol page?

老子叫甜甜 提交于 2019-11-28 06:20:47
问题 actually, i'm developing a web template using ASP.NET and C#. i have a listview in a usercontrol page and inside the ItemTemplate i have a PlaceHolder as below: <asp:PlaceHolder ID="ph_Lv_EditModule" runat="server"> </asp:PlaceHolder> i want to access to this PlaceHolder from code behind and i have use different method as below but i couldn't access it. PlaceHolder ph_Lv_EditModule = (PlaceHolder)lv_Uc_Module.FindControl("ph_Lv_EditModule"); or PlaceHolder ph_Lv_EditModule = (PlaceHolder)this

ie9 placeholder兼容代码方法

随声附和 提交于 2019-11-28 06:13:00
function guid() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); return v.toString(16); }); } function placeholderIe() { function isPlaceholder() { var input = document.createElement('input'); return 'placeholder' in input; } if (!isPlaceholder()) { //不支持placeholder 用jquery来完成 $(document).ready(function() { if (!isPlaceholder()) { $("input,textarea").each( function() { if ($(this).val() == "" && $(this).attr("placeholder") != null) { var self = this; var onlyId = guid(); $(self).attr("data-pid",

IE9以下 placeholder兼容

谁说胖子不能爱 提交于 2019-11-28 06:12:49
//input placeholder兼容!(function ($, doc, win) { $.fn.placeholder = function () { var i = doc.createElement('input'), placeholdersupport = 'placeholder' in i; if (!placeholdersupport) { var inputs = $(this); inputs.each(function () { var input = $(this), text = input.attr('placeholder'), pdl = 0, height = input.outerHeight(), width = input.outerWidth(), placeholder = $('<span class="phTips_tadllj">' + text + '</span>'); try { pdl = input.css('padding-left').match(/\d*/i)[0] * 1; } catch (e) { pdl = 5; } placeholder.css({ 'margin-left': -(width - pdl), 'height': height, 'line-height': height +

IE9以下 placeholder兼容

℡╲_俬逩灬. 提交于 2019-11-28 06:12:34
//input placeholder兼容!(function ($, doc, win) { $.fn.placeholder = function () { var i = doc.createElement('input'), placeholdersupport = 'placeholder' in i; if (!placeholdersupport) { var inputs = $(this); inputs.each(function () { var input = $(this), text = input.attr('placeholder'), pdl = 0, height = input.outerHeight(), width = input.outerWidth(), placeholder = $('<span class="phTips_tadllj">' + text + '</span>'); try { pdl = input.css('padding-left').match(/\d*/i)[0] * 1; } catch (e) { pdl = 5; } placeholder.css({ 'margin-left': -(width - pdl), 'height': height, 'line-height': height +

placeholder兼容ie9

跟風遠走 提交于 2019-11-28 06:12:26
//placeholder兼容ie9 function isPlaceholder(){ var input = document.createElement('input'); return 'placeholder' in input; } if (!isPlaceholder()) {//不支持placeholder 用jquery来完成 $(document).ready(function() { if(!isPlaceholder()){ $("input").not("input[type='password']").each(//把input绑定事件 排除password框 function(){ if($(this).val()=="" && $(this).attr("placeholder")!=""){ $(this).val($(this).attr("placeholder")); $(this).focus(function(){ if($(this).val()==$(this).attr("placeholder")) $(this).val(""); }); $(this).blur(function(){ if($(this).val()=="") $(this).val($(this).attr("placeholder")); }); } }

ie9 placeholder兼容

强颜欢笑 提交于 2019-11-28 06:12:10
.phcolor{ color:#999;}//css样式 function isPlaceholer(){ var input = document.createElement("input"); return "placeholder" in input; }; function placeholder(input){ var text = input.attr('placeholder'), defaultValue = input.defaultValue; if(!defaultValue){ input.val(text).addClass("phcolor"); } input.focus(function(){ if(input.val() == text){ $(this).val(""); } }); input.blur(function(){ if(input.val() == ""){ $(this).val(text).addClass("phcolor"); } }); //输入的字符不为灰色 input.keydown(function(){ $(this).removeClass("phcolor"); }); }; //当浏览器不支持placeholder属性时,调用placeholder函数 if(!isPlaceholer()){ $(

应用中有多个Spring Property PlaceHolder导致@Value只能获取到默认值

旧时模样 提交于 2019-11-28 05:56:10
背景 工作中负责的一套计费系统需要开发一个新通知功能,在扣费等事件触发后发送MQ,然后消费MQ发送邮件或短信通知给客户。因为有多套环境,测试时需要知道是从哪套环境发出的邮件,又不想维护多套通知模板,因此就打算在各环境的properties中声明不同的title前缀,实现类似 [DEV]您的xx月账单 、 [TEST]您的xx月账单 的效果,但是这个前缀需要在生产环境中去掉,因此我想到用 Spring @Value 的默认值来实现,伪代码如下: @Value("${notice.mail.titlePrefix:}") private String mailTitlePrefix; public void doSendEmail() { ... String title = "xxx"; if (StringUtils.isNotBlank(mailTitlePrefix)) { title = mailTitlePrefix + title; } mailSender.send(title, content, recevier); } 采用上述代码后,运行发现,即使在properties中配置了值,但是 mailTitlePrefix 一直是空字符串 "" ,一旦把冒号去掉又能正常读取到配置的值,修改 : 后面的数据为其他值,如 @Value("${notice.mail