• 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">
  • How to show an alert (or hidden div) when selecting a particular option in a select element

    This is probably a simple question, but I'm not sure how to do it. I'd like to have an alert of some type, either standard alert or a hidden div, show up when a user selects an option in a select element. For instance, if a select element has 5 options in it and the user chooses the first one, they would get an alert that says "You have chosen the first option". I'm confident this is something that can be done with a few lines of code, but I'm not sure where to begin. Here's the logic - I'm just
  • Syntax error in jquery-3.2.1.min

    I downloaded jquery-3.2.1.min and jquery-3.2.1 After starting a simple HTML-script like this <!DOCTYPE html> <html>     <head>         <meta charset="utf-8" />         <title>R.30's jquery test</title>         <script src = "../jquery/jquery-3.2.1.min.js"></script>     </head>     <body>         <h1>Here are some tests to be done with <span style = "color: red">jquery</span> ... </h1>     </body> </html> the firefox console reported hundred times the following error found in the jquery script:      
  • Conditional hiding and showing divs

    I have two divs (div1 and div2) which I would like to be shown depending on whether a checkbox is checked and which option is selected from a dropdown box. I currently have this code but it doesn't work very well since if the checkbox is unchecked, the divs are still shown and i don't know how I would fix this: Any help would be fantastic! <script>                 $(function() {                          $('#div1').hide();                         $('#div2').hide();                         $('#boxid').change(function()
  • Oxygen eclipse JQuery Plugin

    Hi All,    Greetings.  I'm a new bie here and to JQuery. Could someone please show me a light on how to get suitable JQuery Plugin for Eclipse Version: Oxygen Release Milestone 6 (4.7.0 M6).  Before I'm here,  I searched this forum and search engine but ended with no help as I got the pages to ask to use other IDE or Not found sites. So, Help me to download a plugin from JQuery site itself. Kind Regards Mohammed SArdar
  • Hide dialog

    I need help. I create a dialog using: var newDiv = $(document.createElement('div'));  newDiv.html('content'); var d = newDiv.dialog({ id: 1, title: 'New dialog' }); When i execute d.hide() only hide content dialog and not hide titlebar. How to hide the complete dialog?
  • jquery.validate - fade out highlight/unhighlight valid classes after time period

    Hello, I am using jquery-validate 1.16.0 with query 1.12.4 and jquery-migrate 1.4.1 and am wondering if someone can please help me. Disclaimer: I am not a programmer so please go easy on me :) I have got a nice highlight/unhighlight function happening to either add/remove the error/valid classes on the grandparent div of checkboxes as well as on the text inputs. This works nicely at the moment and can be seen below:         highlight: function (element,errorClass,validClass) {             var options
  • Help with draggable widget trying to limit its function

    Hello, i´m new in this forum, so if a make a mistake please guide me, i succsesfully load the draggable widget within adobe edge animate and export it to muse, it works, but my problem is that i can make it drag only horizontal, but it has no end, i try to make like a carousel, but obviously i drag it and goes off the edge of the frame, what i need is a way so it could get back to a certain position, not the starting point, or, better if its possible, to loop the images over and over, the most close
  • Array variable inside contains()

        var good = [         "Label1",         "Label2",         "Label3"     ]; var goodlen = good.length; var i; var x = good[i];    for(i = 0; i < goodlen; i++){        $("span:contains('"+ x +"')").hide();    }         <span class='xxx'>Label1</span> <span class='xxx'>Label2</span> <span class='xxx'>Label3</span> I cant tell whats wrong here. I actually had it working and now Im not sure what happened. I  cant figure out what the correct syntax is of putting the x variable inside the jquery line.
  • Next Page

  • Announcements

  • The Basics of jQuery AJAX

    A step-by-step tutorial for those new to jQuery and wanting to use AJAX in their projects. Includes valuable information about troubleshooting using the console and understanding the request / response. http://jayblanchard.net/basics_of_jquery_ajax.html
  • jQuery Conference 2010: Boston Announcement

      The jQuery Project is very excited to announce the jQuery Conference 2010: Boston on October 16-17, 2010.  The conference will be held at the Hilton Boston Logan in Boston, Massachusetts.  The best part of this announcement is that Tickets are on sale now!  This venue is the largest that the project has worked with to date (Harvard Law School in ‘07, the MIT Stata Center in ‘08 and Microsoft New England Research Center in ‘09) and we expect to sell out very quickly. A brief synopsis of some of