草庐IT

CONFIG_VALUE

全部标签

javascript - 如何检查表单输入是否有值(value)

我正在尝试检查表单输入是否有任何值(无论值是什么),以便我可以将该值附加到提交时的操作URL(如果它确实存在)。我需要在添加值之前添加参数的名称,只留下一个空白的参数名称,如“P=”而没有任何值会弄乱页面。这是我的代码:functiongetParam(){//reseturlincasetherewereanypreviousparamsinputteddocument.form.action='http://www.domain.com'if(document.getElementById('p').value==1){document.form.action+='P='+docu

javascript - Select2.js v4.0 : how set the default selected value with a local array data source?

通过使用select2.jsv4插件,当我使用本地数组数据作为源时,如何设置默认选择值?以这段代码为例vardata_names=[{id:0,text:"Henri",},{id:1,text:"John",},{id:2,text:"Victor",},{id:3,text:"Marie",}];$('select').select2({data:data_names,});如何设置id3为默认选中值? 最佳答案 $('.select').select2({data:data_names,}).select2("val",3);

javascript - 与 document.forms[0].elements[i].value; 等效的 jQuery 是什么?

什么是jquery等效于:document.forms[0].elements[i].value;?我不知道如何在jQuery中遍历表单及其元素,但想知道该怎么做。 最佳答案 通常的翻译是:input选择器:$("form:first:input").each(function(){alert($(this).val());//alertsthevalue});:first是因为您的示例提取了第一个,如果只有一个或您想要所有输入元素,只需使用:first离开。:inputselector适用于,,...您通常关心的所有元素都在这里。

javascript - 谷歌可视化堆叠条形图 : colors and labels for each value

我正在使用GoogleVisulaizationAPI来呈现一个图表,该图表显示具有多个值的单行,如下所示:使用以下代码:vardata=google.visualization.arrayToDataTable([['','0%','25%','50%','75%','100%',{role:'annotation'}],['Mood',3,7,20,25,45,'']]);varoptions={isStacked:true,hAxis:{minValue:0}}varchart=newgoogle.visualization.BarChart(document.getElemen

javascript - WebDriverIO Selenium 将命令行参数从 config.js 文件传递​​到 Chrome

我需要chrome运行带有disable-web-security标志的UI测试。如何使用wdio.config文件(http://webdriver.io/)注入(inject)任何命令。capabilities:[{browserName:'chrome'}] 最佳答案 您可以使用goog:chromeOptions在所需功能内设置任何chrome标志capabilities:[{browserName:'chrome','goog:chromeOptions':{args:['disable-web-security']}}]

Javascript getElementsByName.value 不起作用

这个问题在这里已经有了答案:WhatdoquerySelectorAllandgetElementsBy*methodsreturn?(12个答案)关闭1年前。我正在尝试制作一个简单的javascript程序,但它无法正常工作。请帮忙。在Eclipse中,我创建了一个动态Web项目,在DD中,我的欢迎文件是index.jsp。下面给出了我的index.jsp代码Duncan'SfunctionnameSubmit(){alert(document.getElementsByName("username").value);}functionCakeNumber(){alert(docum

Javascript : onchange event does not fire when value is changed in onkeyup event

这个问题在这里已经有了答案:Javascript:"onchange"eventdoesnotworkwith"value"changein"textinput"object(1个回答)关闭9年前。我有这个简单的代码:我不知道为什么当我按下键时文本框的值发生了变化,但onchange事件没有触发。我怎样才能触发onchange事件?

javascript - jQuery 日期时间选择器 XDsoft : How do I get value from inline calendar?

我使用XDSoft的jQueryDatetimepicker插件:http://xdsoft.net/jqplugins/datetimepicker/我有内联显示的日历。这是我的代码:HTML:JS:jQuery('#start_date').datetimepicker({format:'d.m.YH:i',inline:true});我的问题:当我在前端选择一个日期时,输入字段没有将所选日期作为值。我需要进行哪些更改或需要添加哪些内容? 最佳答案 从Onchange事件中获取值试试这个onChangeDateTime:func

javascript - 无法动态转译 ES 模块 System.config({ transpile : 'transpile-module' })

这是我的tsconfig.js{"compilerOptions":{"experimentalDecorators":true,"emitDecoratorMetadata":true,"moduleResolution":"node","target":"es5","module":"system","noImplicitAny":false,"outDir":"built","rootDir":".","sourceMap":false},"exclude":["node_modules"]我正在使用tsc命令将我的“hello-angular.ts”转译为“hello-angu

javascript - Uncaught ReferenceError : show value is not defined(Only for mobile device)

您好,我已经实现了代码,其中在添加到购物车时会添加商品,还会打开一个显示购物车商品的弹出窗口。在桌面上它运行良好,但在移动设备上它不工作。对于移动设备,它是shoingingerrorasUncaughtReferenceError:showvalueisnotdefined下面是我的代码functionshowvalue(value,product){$('#').text(product);$('#').text(value);$('.cart_popup').show();setTimeout(function(){$('.cart_popup').fadeOut('slow')