QUnit and benchmarking
I was wandering if QUnit has some sort of benchmarking of each test that is run, and, if not, can this functionality be developed into QUnit?
Datepicker change months and years options appears only hover
I am using the DatePicker JQuery UI. I need the functionality to change months and years, but the combos with the options are in trouble. You need to hover over the desired option so that your name appears. I do not understand why this happens. Can someone help me?
Insecure Randomness and Code Injection on 1.10.2 version
Our team is using the jquery library version 1.10.2 for our jquery needs for the internal site. During our recent Fortify security scan, we found various vulnerability like the Insecure Randomness and Code Injection. I am attaching the screen shots of this vulnerability. Can you please give your feedback
How to compare multiple radio button's value with string?
I'm wondering how to get the multiple selected radio button's value and compare with string? If people click more than one radio buttons, then show all the text that compare with the radio's value. I can now show the text that compare with only one radio button's value, but if I click more than one radio buttons, it still shows the text that I select at first time. For example, in this case: JSFiddle If I click "apple", it shows "apple apple" that's correct, but if I click more than one buttons
Problems after 2nd autocomplete script
Hy @ all Im not good in php, html,... but i got a little page to work for me and my colleges. It takes me some time to get autocomplete to work but finally i was happy. Then i insert the script-part a second time (yes its not a fine way) and changed the necessary parts and also the second autocomplete worked fine. BUT since that time umlauts (ä,ü,ö...) are displayed wrong (ö = ö) if i remove the second script everything is normal again. if somebody has any idea i would be graceful. <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
done or success for $.each
Hi, Why I am getting: Error: 'Uncaught TypeError: $.each(...).promise is not a function', line 132, file 'http://localhost:53470/views/signin.js'. $.each(data, function (index, item) { -------- run some code here ------------- ------------ }).promise().done(function () { alert("All was done"); }); Isn't there any done or success for the $.each? kindly advise how to achieve done or success for $.each Thanks, Jassim
how to find all elements with an attr in jquery?
I found this example but it specifically searches all inputs as opposed to all elements: https://api.jquery.com/attribute-equals-selector/ How can I update this example to search *all* elements in the DOM, not just inputs for those that contain a particular attribute like "myAttribute"?
How to select input type "tel" using jquery by id..??
In my form, I have an input field of type="tel". <input type="tel" name="jform[work_phone]" class="validate-phone" id="jform_work_phone " value="" size="30"> I am setting value to this field using jQuery by jQuery("#jform_work_phone").val("123456"); It is not setting the value. What am I doing wrong..??
toggle closest div tag not working
If you could please help me out with this. I have multiple div tags to show and hide based on he user clicking the plus image. The image isn't uploaded so just click on the placeholder in the example below. What is supposed to happen is based on the + image the user clicks on that div tag should expand to show the extra text. I can only get the top div tag to show/hide at this time. https://jsfiddle.net/hosm8u5s/#&togetherjs=G6TkU6eIcB
Clone svg elements
I'm trying to clone circle components w/in an svg element after first pass but it's putting it in the dom: <svg width="100%" height="100%" viewBox="0 0 42 42" class="donut"> ... <circle class="donut-segment" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#ce4b99" stroke-width="6" stroke-dasharray="0 0" stroke-dashoffset="25"> <desc id="donut-segdesc-0">Some description</desc> </circle> ... </svg> Clone & add another circle & it's desc after the last circle: var firSeg
on('mouseover') not getting associated with element as expected
I'm using the following code to associate a mouseover event with an <a> tag: $('#' + control.Id).on('mouseover', function(){ alert('test'); }); control.Id is a valid control ID that exists on the page. The following code gets a handle to the control on the page: $('#' + control.Id) However, when I try to associate a mouseover event with the on('mouseover') code above, the CDT watch shows "onmouseover: null". Any idea why my on('mouseover') code does not appear to be working as expected?
Zip filter in the right order
Hello, I have a little problem, I hope you can help me. I would like to have a postcode filter, which displays the entries that were entered in the correct order as entered in the input field. e.g. My input 011 output: 01129 10117 10117 The first is correct. The other two are wrong. function looseCharacterMatch(a, b) {a = a.split("");
b = b.substring(0,a.length);
var c = true;
for (var i = 0; i < a.length; i++) {
if (b.replace(a[i], "") == b) {
c = false;
}
b = b.replace(a[i],
How to do synchronous Promise.then() chaining in jQuery v3?
Hi, we have a lot of code where we rely on the jQuery v2 behavior of synchronous calls for promise.then chaining: function getResolvedPromise() { return $.Deferred().resolve("A"); } console.log("code BEFORE processing stuff"); var prom = getResolvedPromise(); prom = prom.then(function (value) { console.log("then1: " + value); return "B"; }); prom = prom.then(function (value) { console.log("then2: " + value); return "C"; }); prom.done(function (value) { console.log("done: " + value); });
Get the value of a value in the widgets CgridView
Good night I'm trying to capture the id of a row cdesde a CgridView I hope they can help me any suggestions I'll be grateful, regards Function that calls the window where the CgridView is located <script > function buscarArticulo() { window.open("../articulo/catInventario", "popupId", "location=no,menubar=no,titlebar=no,resizable=no,toolbar=no, menubar=no,width=500,height=500"); } </script>This is the function in the popup window: <script language="javascript"> function cerrar(idarticulo) { window.opener.document.getElementById('idarticulo').value
Trying to get return value from JSON.parse
I was looking at a horrible example on the mozilla.org page and trying to use it, but since their example is unrealistic I don't quite get it. How do I read the return value? I think the brackets are the problem. I could write some sloppy code to remove them, but is there a better way? For the time being I got rid of the brackets using substring. Not very elegant. var x = data.substring(1,data.length-1); // get rid of the brackets around the json value try { alert(data);
Jquery Ajax with Authorization Headers
I am trying to make Jquery Ajax call to a REST Service.The service excepts Basic authentication which requires User Name & Password. So, while making the Ajax request i have added the Authorization tag in the code.But still i don't see the Authorization tag after the request. var username = "user";
var password = "pwd";
var url = 'mysite.com';
$.ajax({
url: url,
success: function(json) {
alert("Success", json);
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
webshell
How do I use jQuery in a webshell please? Is there something I have to upload into the webshell with the file?
Cloning Pages - Vertical Scroll Bar Appears. (Updated - posted the wrong link)
Hi, I want to clone a page dynamically which I can managed fine. I can then go to view these pages and swipe forwards and back. If I save these pages and reload them on the next run I get a vertical scroll bar appearing when swiping. I have included a fiddle: https://jsfiddle.net/a4poster/ysyxvtyp/422/ If you follow these steps you will see what I mean. 1. Click the "Click To Clone button" three times. 2. Goto and view the clone pages. 3. Swipe across them - this works fine. 4. Click the "Save All
Change step in slider on some event
I have a select list which shows few options, depending on the select option I have different data retrieved so the slider steps are different. Can I change the steps eg. option1 has 5 records and my slider is 400 px then the step is 100 i.e. 0, 100, 200, 300, 400 option 2 has 7 records and my slider is same i.e. 400 px then the step is 66.67 i.e. 0, 66.67, 133.33, 200, 266.67, 333.33, 400 and so on, Can I change steps as I metioned and the slider can reflect this change. Thanks, Sadashiv.
max elements to show Autocomplete Widget
I was using autocomplete widget and i run a query with 6000 items and it was ok. But when I run a query with 6700 and more, the autocomplete doesn't work, someone can help me please!!! var availableTagsItems = [ <6700 items are here> ]; $('#txtInput').autocomplete( { source: availableTagsItems }); $('#txtInput').autocomplete("option", "minLength", 4); $('#txtInput').autocomplete("option", "position", { collision: "flipfit" }); Thanks!!!
What are these datepicker widget files for
I downloaded the datepicker widget (just the datepicker) from this site and i got all of these file and folders: However I got the datepicker working ok by just referring to two of them (query-ui.css and /jquery-ui.js) in the following: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>jQuery UI Datepicker - Default functionality</title> <link rel="stylesheet" href="jquery/jquery-ui.css"> <script src="jquery/jquery-3.2.1.min.js"></script>
Variable in Select not update
Hi, im whit this code var num=1; var num2; $(document).ready(function(){ $('.cntrlr-'+num+'-ok').on('click', function() { num2=num+1; $('.scnr-'+num).addClass('hidden'); $('.scnr-'+num2).removeClass('hidden'); num=num+1; }); The problem is into $('.cntrlr-'+num+'-ok'), only go when the class of object clicled is 1 (.cntrlr-'1'-ok'). The num variable change correctly but the $('.cntrlr-'+num+'-ok') not update. Thanks,
how to check some key and if all values of this key are empty
Hi, I've got this code but it's not correct var test_h2s = JSON.parse($.cookie('name_of_cookie')); JSON.stringify(test_h2s, function(key, value) { // when encoutering one of the keys we're looking for, with all values empty while(key.substr(0, 3) === 'h2s' && value !== "") { //do something }
How to force Google Chrome open "save as" dialogue?
Are there any way to force Google Chrome open "save as" dialogue if user didn't change browser's default setting? I know the dialogue can pop-up if user switch on "ask where to save each file before downloading" in Chrome's advanced settings, but I can't ensure every user knows that. Anybody know the solution? Thanks for any answer.
Inexplicably failing tests when run in a full suite: what can I do?
I currently have 40 tests with approximately 200 assertions running. When all of them are run, the same two are almost always failing. Run individually, or with about half of all the available tests, they pass. The total running time is typically 8-10 seconds. If I run *all* the tests with the developer console open (set up so that the browser cache is not used), the same two tests *always* fail - the total running time is closer to 30 seconds). Almost all of these tests involve the following
Allow minus character at first in input box
Hi , I am using the below code to allow minus (-) sign at the first position, where it is happening. But if in case i enter a number and then move the cursor to first position i am unable to enter the minus (-) sign. http://jsfiddle.net/7XLqQ/3/ Looking forward for the response. Thanks in Advance, Ravindra
Return list of items from success: function
I want to return a list of values from success: function(data) but currently my Jquery is returning single values. I also need to get the values into an html horizontal <td></td> format. Below is my Jquery. Any help will be appreciated. select: function (event, ui) { debugger; $.ajax({ cache: false, async: false, type: "GET", url: "@(Url.Action("Product", "Parent"))", dataType: 'json',
trigger a swipe event
hi I'm using this great swipe function that works perfectly. found here: http://labs.rampinteractive.co.uk/touchSwipe/demos/Basic_swipe.html I can't find a way to trigger this swipe event from another div click. That is to say - user clicks on #div1 and it fires $(#test).swipe.I tried trigger, bind event, a few other things and no luck. any clues ?
Clear Autocomplete data when new item is searched
Hi, I am trying to use Autocomplete in SharePoint custom list. I have used the below code for the autocomplete functionality $(document).ready(function() { var titles = []; var autocomplete = $("input[title='Skill Required Field']").autocomplete({ minLength: 3, source: function(request, response) { $.ajax({ url: siteURL + "/_api/web/lists/getbytitle(\'MySkills\')/items?$select=Title&$filter=startswith(Title, '" + request.term + "')", cache: false,
JQuery mobile application returns to first page on update
I have created a single page application with two pages. This is used with hand held android barcode scanner devices that we use in our warehouse. The user scans a location tag on a shelf. This causes an ajax call to check that this is a valid location. If location is valid code moves to the barcode scan page. On this page we scan item barcodes. Each scan causes an ajax call to our back end and retrieves data on the item. This all works, except that after each ajax call the application returns to
Support for ARIA standards
Will this jquery datepicker support accessibility (as per the ARIA standards) for screen reading purpose ??
modifying the default tabs initialization to prevent the panel display on the first tab
When using the jQueryUI tabs, how can I prevent the default tab setting from opening the text panel when the page loads? so it only displays the text panel when the tab is selected.
css method not working.
Well I actually have 2 questions, but the first one is the css method. I have 3 buttons that I want to change the background color to blue and font color to white. As far as the directions go this is not after any click event, the click events do something else. So I tried using the button ID, and the Div ID the button is in to change the color but no luck. #area3 is the div id, and #move up is the button id, but again neither worked $(document).ready(function(){ $("#area1").offset({top: 250,
Showing Response Status using JQuery
What I'm trying to do is download some image from a URL then upload it to WordPress post, my form below: <form method="post" id="upload"> <?php foreach($data as $row): ?> <label>URL</label> <input type="text" id="url_<?php echo $row->id;?>" name="data[<?php echo $row->id;?>][url]" value="<?php echo $url;?>" /> <?php endforeach;?> <button name="act" value="savepost">Save</button> </form> <!-- showing result here --> <div id="result"></div> So, then when click Save button... the action will call function
GET method returns 500 Internal server error.
Hello. I'm new here so I have some question. So I'm developing a web page, but there ir some problem. I have map with are tags, that onclick runs a function "getObject(this.alt)". function getObjects(object){ console.log(object); $.get("/sites/map/objects.php?t="+object, function(data) { $('#answer').html(data); }); Ir runs file object.php were t= area tags alt attribute, the objects.php connects to MySql and returns objects row, but I get this kind of error: GET http://mysite.com/sites/map/objects.php?t=some_object
How to get all elements with this multi value attribute?
Assume I have a web page with multiple instances of elements that have (among others) the following CSS definition: #........... { ..... border: 1px dashed #ddd; ..... } How can address all these elements with jQuery? The following does not work: $("[border: 1px dashed #ddd]") How else does that work? Peter
Two buttons for one form
Hi, I have below view which has Save and Delete buttons.. The Save button will invoke: $('#frmContact').submit(); But What's the best way to invoke the Delete button? Kindly advise.. <div id="popupCustomerContact" style="display: none;"> <form id="frmContact"> <div id="lookupContactCategory" style="margin-bottom: 20px;"></div> <div id="txtContactDetails" style="margin-bottom: 20px;"></div> </form> <center> <div id="btnDeleteContact" class="savannadeletebutton"
appending a value from dialog box to body
I am having a problem of appending a value from the textbox in the dialog box to my html body. <div id="dialog-form"> <form> <label for="name">Name</label> <input type="text" name="name" id="txt2 codein" class="text ui-widget-content ui-corner-all" /> </form> </div> <p>Please are you <span id="addname"></span> setTimeout( function() { $( "#dialog-form" ).dialog({ modal: true, draggable: false, height: 300, width: 500, open: function () { $('body').addClass('stop-scrolling'); }, }); },4000); var keeptrying
data-* attribute
I am using the data-* attribute to give specific elements unique data and am using the element.dataset.value syntax to read the values when i try to read the values the data names are always lower case even if i used upper case in the html so <div id="a" data-User> object = document.getElementById("a"); //DOES NOT WORK object.dataset.User //DOES WORK object.dataset.user why is this?
show certain div by choosing option in two select's (html form tag)
Create a simple html page with a form. Form elements: - dropdown 1 options: red, green, blue - dropdown 2 options: rectangle, circle - button “Add” 1. When user clicks “add”, the appropriate figure should appear on the page. 2. User should be able to remove any figure 3. Add clear button, which clears all figures on the page should use jQuery. how to do it ? I'd try something like this: HTML <div id="main"> <form action="#"> <ul> <li> <select id="color" name="color">
Next Page