Tag: jquery

如何使用REST和本地JavaScript访问HP ALM?

我只想通过REST API在浏览器(IE11,Firefox)中通过本地编写的javascript js访问ALM ,但我无法登录。 这是我通过jquery请求LWSSO cookie的代码: var auth = btoa(USER+”:”+PASSWORD); $.ajax({ type: “POST”, url: https://alm.xxx.net/qcbin/authentication-point/j_spring_security_check, headers: { “Authorization”: “Basic ” + auth }, success : function(data) { }, }); 响应头包含: https://alm.xxx.net/qcbin/authentication-point/login.jsp;jsessionid=1gfsdk4pn525f1ur55e2x2zzte?login_error 使用OTA/directX对象一切正常但我想通过javascript使用REST API。 谁能帮我?

WordPress下拉菜单点击打开

我正在尝试创建一个单击时打开的wordpress下拉菜单。 当你选择一个post并且页面加载该post时它应该保持打开状态。 问题是我正在使用自定义菜单项链接,它链接到任何内容(“#”)只是为了使它们可以点击。 单击“可点击的第二级标题项”时菜单打开,但“第三级post”上的链接不起作用,而是单击它时菜单关闭。 HTML: Main menu title item Post 1st lvl Post 1st lvl Post 1st lvl Post 1st lvl Clickable 2nd level title item Post 3rd lvl Post 3rd lvl Post 3rd lvl jQuery的: $(‘#menu-header ul.sub-menu li.second:not(“.third”)’).toggle(function() { $(this).find(‘ul.sub-menu:first-of-type’) .stop(true, true).delay(50).show(“slow”); }, function(){ $(this).find(‘ul.sub-menu:first-of-type’) .stop(true, true).delay(150).animate({ “height”: “hide”, “opacity”: “hide” }, 400 ); […]

具有重置function的倒数计时器,使用jquery和downCount

我正在使用来自http://www.jqueryscript.net/time-clock/Extremely-Lightweight-jQuery-Countdown-Timer-Plugin-downCount.html的倒数计时器 我想添加一个重置计时器的按钮。 没有内置function,所以我编写了自己的function来完成它。 我是javascript的新手,无法让时钟倒计时(在我的网站上工作,因为某种原因不在jsfiddle中)或实际重置。 我在这里构建了一个JSFiddle: https://jsfiddle.net/9dzu7g6a/ 复位function: function reset(){ var date = new Date(); var day = date.getDate(); var month = date.getMonth()+1; var year = date.getFullYear(); var hour = date.getHours(); var minutes = date.getMinutes(); var seconds = date.getSeconds(); var dateString = day + ‘/’ + month + ‘/’ + year + ‘ ‘ + hour […]

重置Jquery Select2多个下拉列表会导致选择空白项目?

我在用户注册页面中使用Multiple Select2插件。点击提交按钮,保存详细信息后我将重置下拉列表。问题是当我从下拉列表中选择另一个项目时,会在下拉列表中自动选择一个blank item HTML @Html.DropDownListFor(m => m.MultipleCourseId , Model.MultipleCourseList , “” , new { @class = “form-control select2”, @id = “ddlCourseMultiple”,@multiple=”multiple” }) 在Jquery按钮上调用重置单击 $(document).on(“click”, “#btnCancel”, clearAll); //clear all controls var clearAll = function () { $(“.form-control”).val(”); //resetting dpdwn for clearing the selected option $(“#ddlCourseMultiple”).select2(“val”, “”); return false; };

jQuery的click()只能为DOM 0和通过jQuery注册的事件处理程序触发事件处理程序……?

[更新:]这个问题与:jQuery的click()有什么关系? jQuery的click()没有点击? 以下代码: some content Click Me [ … ] onload = function() { $(‘#clickme’).click(function() { $(‘#oneDiv’).css({border: ‘6px dotted #07d’}) }); document.getElementById(‘clickme’).onclick = function() { document.getElementById(‘oneDiv’).style.color = ‘green’; } document.getElementById(‘clickme’).addEventListener(“click”, function() { document.getElementById(‘oneDiv’).style.background = ‘#ffc’; }, false); // bubbling phase setTimeout(function() { $(‘#clickme’).click(); }, 3000); } 如果单击该链接,则浏览器将显示 1)将边框更改为6px点蓝色 2)将div内的文本更改为绿色 3)将div的背景改为offwhite 4)访问www.google.com 但是如果你等待并让setTimeout()的函数启动,那么它只会执行 $(‘#clickme’).click(function() { }) […]

如何在jquery模式对话框中设置cookie

我想在我的modal dialog中添加cookie,但我不知道如何。 我想在24小时内添加cookies,有人可以帮忙吗? 这是modal dialog的代码: $(function() { // a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore! if ($.cookie(‘showDialog’) == undefined || $.cookie(‘showDialog’) == null || $.cookie(‘showDialog’) != ‘false’) { $( “#dialog:ui-dialog” ).dialog( “disable” ); $( “.selector” ).dialog({ hide: “slide” }); $( “#dialog-modal” ).dialog({ width:860, height: 420, modal: true, resizable:false, draggable:false }); $.cookie(‘showDialog’, […]

JQuery向div标签添加多个类

我想使用JQuery获取下一行代码: 我使用$(document.createElement(‘div’)); 创建div,但是如何在div中添加something和something_else呢? 我确信这是基本的东西,但我似乎无法弄明白。

每次刷新时JSON数据都会更改

我得到了一个从json文件中获取数据的ajax调用。 之后我计算物体的长度并获得长度。 一切都很好。 但是在刷新时它不会以相同的顺序显示数据 //url i get from another file.which is a object hardcoded. var initialsource = [{ “data”: [] }]; var totallength = url.length; var j = 0; // dummy variable to check whether the data has reached full length; $.each(url,function(keys,values){ console.log(keys); // get the keys which is mapped to json file location.// 1st […]

jQuery幻灯片下一个/上一个

我是jQuery的新手,我只是想知道创建下一个/上一个按钮以完成幻灯片放映的最简单,最有效的方法。 我的代码如下: run = setInterval(“switchSlide()”,2000); $(document).ready(function(){ $(’#slideshow img:gt(0)’)。hide(); $(’#slideshow’)。hover(function(){ clearInterval(运行); },function(){ run = setInterval(“switchSlide()”,2000); }); $(’#play’)。click(function(){ run = setInterval(“switchSlide()”,2000); }); $(’#stop’)。click(function(){ clearInterval(运行); }); $(’#previous’)。click(function(){ $(’#slideshow img:first’)。fadeOut(1000).prev()。fadeIn(1000).end()。appendTo(’#slideshow’); }); $(’#next’)。click(function(){ $(’#slideshow img:first’)。fadeOut(1000).next()。fadeIn(1000).end()。appendTo(’#slideshow’); }); }); function switchSlide(){ $(’#slideshow img:first’)。fadeOut(1000).next()。fadeIn(1000).end()。appendTo(’#slideshow’); }

同位素网格布局使用空白空间

我有一个网格(3×3),它是300px,每个网格字段是100px宽。 如果你在这里看看jsfiddle,它很容易解释。 Onloads布局同位素它运行良好,但是如果你点击li元素#2上的网格将被采用,但没有正确使用它的空间。 为什么li 3和空区旁边? li 4适合那里! 思想同位素会处理这个吗? 怎么弄这个? 谢谢你的帮助! frgtv10 http://jsfiddle.net/pEZtj/