Web应用程序中的确认消息框(Confirmation message box in webapplication)
在asp.net web应用程序中使用下面的消息框。 现在我想将此消息框转换为确认消息框,并在确实消息框中执行某些操作,否则表示拒绝该应用程序。
ScriptManager.RegisterStartupScript(this, this.GetType(), "temp", "<script language='javascript'>alert('Are you sure, you want to apply?');</script>", false);
Am using the below message box in asp.net web application. Now i want to convert this message box as a confirmation message box and do something when it is true else means reject the application.
ScriptManager.RegisterStartupScript(this, this.GetType(), "temp", "<script language='javascript'>alert('Are you sure, you want to apply?');</script>", false);
原文:https://stackoverflow.com/questions/11861271
更新时间:2023-04-18 16:04
最满意答案
您可以创建一个空DOM元素和.append()
var entry_set = $("<div>"); //empty dom element // start to loop data var i = 4; while(i--) { // create HTML element to represent that data var item = $('<div>', { text: "test " + i }); entry_set.append(item); } // modify DOM only once all the entries are consolidated to a single jQuery object $("body").append(entry_set.children());
工作演示: http : //jsfiddle.net/F2J6g/1/
编辑您也可以从空集合开始并使用.add()
var entry_set = $(); //empty collection // start to loop data var i = 4; while(i--) { // create HTML element to represent that data var item = $('<div>', { text: "test " + i }); entry_set = entry_set.add(item); } // modify DOM only once all the entries are consolidated to a single jQuery object $("body").append(entry_set);
You could create an empty DOM element and .append() to that
var entry_set = $("<div>"); //empty dom element // start to loop data var i = 4; while(i--) { // create HTML element to represent that data var item = $('<div>', { text: "test " + i }); entry_set.append(item); } // modify DOM only once all the entries are consolidated to a single jQuery object $("body").append(entry_set.children());
working demo at: http://jsfiddle.net/F2J6g/1/
EDIT You can also start with an empty collection and use .add()
var entry_set = $(); //empty collection // start to loop data var i = 4; while(i--) { // create HTML element to represent that data var item = $('<div>', { text: "test " + i }); entry_set = entry_set.add(item); } // modify DOM only once all the entries are consolidated to a single jQuery object $("body").append(entry_set);
相关问答
更多-
$().map()将返回类似数组且具有length jQuery对象,但不是可以使用Array.prototype方法的正确数组。 您需要使用get()返回正确的数组,或使用$.map() : var otherFields = $('[name$=test]').map(function() { return $(this); }).get(); 使用$.map() : var otherFields = $.map( $('[name$=test]'), function(elem) { retur ...
-
您需要比较原始DOM元素,例如: if ($(this).parent().get(0) === $('body').get(0)) 要么 if ($(this).parent()[0] === $('body')[0]) You need to compare the raw DOM elements, e.g.: if ($(this).parent().get(0) === $('body').get(0)) or if ($(this).parent()[0] === $('body')[0] ...
-
您可以使用add()或merge()方法: 加: el1.add(el2).change(function (e) { //.... }); 合并: $.merge(el1, el2).change(function (e) { //.... }); You can use add() or merge() method: Add: el1.add(el2).change(function (e) { //.... }); Merge: $.merge(el1, el2).ch ...
-
连接jQuery对象(concatenating jQuery objects)[2022-04-13]
您可以创建一个空DOM元素和.append() var entry_set = $(""); //empty dom element // start to loop data var i = 4; while(i--) { // create HTML element to represent that data var item = $('', { text: "test " + i }); entry_set.append(item ...lodash是一个不错的选择。 您可以为您的案例使用_.mergeWith函数。 例如来自lodash api指南 function customizer(objValue, srcValue) { if (_.isArray(objValue)) { return objValue.concat(srcValue); } } var object = { 'a': [1], 'b': [2] }; var other = { 'a': [3], 'b': [4] }; ...jquery .each对象(jquery .each objects)[2023-02-16]
在你的例子中,要确定你想要做什么有点困难,但是如果你想使用arrays和$.each ,你可以这样做: var defaults = { test: 'yes', //css/classes types: [ { minvalue: '100', maxvalue: '200', name: 'id1' }, { ...您在循环中构建标记,使用索引访问与当前迭代的数组对应的数组值,并在构建完所有内容后将其插入DOM var html = $([]); $.each(data.images, function(index, value) { var wrap = $('', {'class' : 'wrap'}), box = $('', {'class' : 'box'}), inner = $('', {'class' : 'boxInner' ...是的你可以。 jQuery对象是JavaScript对象。 var $a = $("#a"); var $b = $("#b"); var c = {}; c.foo = $a; c.bar = $b; 作为关键? 不,你不能。 JavaScript对象是键和值之间的映射。 键是字符串 ,值可以是任何值。 来源: https : //developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Objects Yes, you can. ...jQuery中的对象(objects in jQuery)[2023-09-08]
请记住,jQuery只是一个运行在Javascript中的库; 你在谈论的是Javascript中对象的概念。 这种事情的权威是道格拉斯克罗克福德。 我推荐这个视频作为介绍: http : //video.yahoo.com/watch/630959/2974197 Remember that jQuery is just a library that runs in Javascript; what you are talking about is the concept of an object in ...在纯jQuery中不可能,因为语法已经用于DOM元素。 但是一个简单的插件可以很好地完成工作: http://jsfiddle.net/gMDjZ/ a = $('div:eq(0)'); b = $('div:eq(1)'); c = $('div:eq(2)'); d = $('div:eq(3)'); e = $('div:eq(4)'); f = $('div:eq(5)'); jQuery.fromArray = function(a) { var c = jQuery(); f ...相关文章
更多- Storm - Guaranteeing message processing
- Hibernate在Web应用程序中使用示例
- RabbitMQ 消息确认方式
- Gradle构建Java Web应用程序并在Tomcat上运行
- js使用层弹出确认框如何实现?
- HTML5项目笔记8:使用HTML5 的跨域通信机制进行数据同步
- JMS&MQ系列之简单JMS应用程序编写步骤
- log4j 核心API Logger的相关方法
- SonarQube集成到Eclipse中
- JMS&MQ系列之简单示例
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)