• math.random returns last function in array

    Hi, strictly this is a javascript question, but am posting here because the functions involved use jQuery. I've made a function which is supposed to return a randomly-selected function from an array of five.   I've been testing by changing the order in the array, clearing cache, using different browsers, but I'm always getting the last function in the array. "Always" meaning ten iterations of clearing cache and histpry, and trying again. function jun12() {startEm('june12','welcome12')} function jul01()
  • Autocomplete not working in iframe only in IE 11 - works in Chrome

    I am working on an old MVC application that is having problems displaying an @Html.DropDownListFor that has 15,000 rows in IE 11. I replaced the DopDownList with the jQuery autocomplete and it works great in the application. The problem is that the application is also displayed in another web page in the organization in an iframe. The old DropDownList worked fine in the iframe, but since I replaced it with the autocomplete, it wont work. When text is typed in the autocomplete, nothing happens. I
  • $ Variable in this code

    http://jsfiddle.net/TLdp9/6/ In this code, line 4. What's the $ about? When I run the code I get this error "Uncaught ReferenceError: $ is not defined"
  • Help with a simple lookup page

    I am new to this type of coding after nearly 10 years of Autohotkey, and have tasked myself with an online Karaoke book lookup, that will work on a phone, I have the basics working fine, but have a question or two, 1. Can a csv file be searched, without being loaded into a table first, just display any search hits in a table? (the file i am searching is book.txt) and my delimiter is ^ 2. I am using a load Songlist button to force DB refresh whenever i load the page, Does this make sense?  Working
  • Image not open at bigger size on mouse hover

    Hi, I placed one small image on right bottom of my website. Once user mouse hover the image it opens or expand the image as original size in same place.It should hide the small image and shows the bigger image(original image) on that place. My code worked for placing small code initially. after hover the image, the bigger image not opened properly. have some issues.  Kindly help this for solving this issue using javascript or jquery or CSS. <div class="bcFloat" style="display: block; left: 933.12px;
  • Problem in selecting li

    <ul> <li><a href="#">Books</a> <ul> <li><a href="#">New Books</a></li> <li><a href="#">Old Books (2017)</a></li> </ul> </li> </ul> When I am trying to access 'Books' . Jquery is also giving me 'New Books' and 'Old Books (2017)' js code is.. var li = $("ul :last-child").find('a').text(); alert(li); Please help...
  • Map and Autocomplete only work after refresh

    Hi, I just started using jQuermobile and I ran into a problem. My project consist of four pages, all loaded into the index.php via GET... https://fuel.vietze.org/ The first page inclues a OpenLayers Map, which doesn't work initially, when the page is loaded. Only after I refresh the browser once, it loads and displays perfectly. A similar effect prevails with an autocomplete form that is included in the top of every page. Upon initial page loading, you can type in the field, but autocomplete won't
  • jquery writes a double-click to a variable

    I have such a problem, I have a code, and in this whole program the idea is for him to perform some action under the condition of what will happen in the result variable and he performs this action but I will double on this button. Code js  function edit_drugs (url, idDrugs, i, url2, url3) {         $ ("# EditDrugs" + i) .load (url + "? IdDrugs =" + idDrugs);         $ ("# updateDrugs" + i) .html ("<input type = 'button' class = 'btn btn-success' onclick = update_drugs ('" + url2 + "'," + idDrugs
  • Sending picture & data to DB

    Hello, Little difficulte to explain my problem... Ok I have a form with inputs and image upload. I have two object JSON One with the image converted to Base64 then converted to JSON string One with all the other inputs. Now I want to send it to my controller and DB. But I totally don't succeed. This is a github link to check the HTML and controllers also a screenshot of DB diagram The main problem is when I want to send the picture I need the RecipeID (int AddRecipe) but how can I get it to add it
  • command keeps repeating n Number of times

    Hi, I am new to this forum and Jquery. I need help with this code I have two tables table1 on the left  and SelStudent on the right. table1 has checkbox on each row which when clicked fires the function below. My problem is when I click a checkbox on any row in table1,      1  record is appended to SelStudent Table   $("#SelStudent").append(ttext);   runs once, as expected) when I click another checkbox in any row of table1, 2 records are appended to SelStudent table   $("#SelStudent").append(ttext); 
  • Counting the selectedCell class

    I'm trying to count the number of selected cells with class="selectedCell" for each row in the following code. $(function(){     var output = $('table').find('td.selectedCell').length + ' selected cells';   $(".tdoutput").html(output);    }); I have a working example here, but the count shows the same for each row, and instead it shows the total count for the table. http://jsfiddle.net/tbeup691/
  • Slideshow with thumbnail grid and support for images and youtube video

    Can anyone recommend a slideshow plugin that supports both images and embedded youtube videos.  I need something that will look like the below mockup when you click on a thumbnail the image or video is loaded in the larger preview window. The images that would be used are variable sizes so ideally think it would need to use a container possibly utltising CSS background-size:cover to get a decent coverage of each thumbnail whilst keeping everything uniform in the thumbnails grid.
  • Changing db data with representative values with jquery

    I have a simple table.   <table class="tb"> <tr><th>ColA</th><th>ColB</th><th>ColC</th></tr>  <tr><td>10</td><td>12,3</td><td>24,5</td></tr>  <tr><td>40,4</td><td> </td><td>5,5</td></tr> </table> I would like to change the original mysql data with representative values that I assign to them. So if there is a value in the first column, then they are all replaced with 1, if there is a value in column 2, then it is replaced with 2, if not, it is left blank, and it goes on like this. Would it be possible
  • jQuery find function with escape characters not working in latest version

    I have a selector in a find function that works with jQuery 3.3.1 and before that doesn't in 3.4.0 and 3.4.1. I am using it on an xhtml jQuery document object that I have used $.parseXML on. I am using the full version of jQuery. I have looked into the jQuery changelogs and see nothing that should affect this, as well as in the source changes on github. I have tested the find with .class and #id and it works, but the IDs will be dynamic so I need to search by attribute name. There will also be multiple
  • Highlighting between two data points on a scale

    I have a php generated scale table from 1 to 14. I highlight the min and max values given by the checkbox form on the table with the following jquery code. This is the jquery code I'm using to highlight two points on the scale table. $("#checkAll").click(function() {   $('input:checkbox').not(this).prop('checked', this.checked)     .trigger("change"); }); $(".selector").on("change", function() {   var parent = $(this).closest("form");   $("#" + parent.data("checktable"))     .find('[dbval="' + this.name
  • question on using textarea events

    hello -  i want to use an event when a textarea has changed, but only actually respond AFTER the user appears to be completed. the best i have come up with is something like this: flag = null;   // define input response flag jQuery('input[name=textAreaField]').on('change input', ()  =>      {         flag = true;   // set input response flag }) jQuery('input[name=textAreaField]').on('mouseleave', ()    =>      {       if  ( flag )       {                flag = false;  // reset input response flag
  • Setting a cookie with JavaScript which expires after 24 hours

    How do I run this function, so that the cookie expires in 24 hours? function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } Thanks
  • Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience

    how can browser console log warning : "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience" ? My jquery version /*!  * jQuery JavaScript Library v3.4.1 My ajax script $.ajax({   url: '$url',   type: 'post',   // dataType: 'json',   // data: data, })  .done(function(response) {        $("#inject").html(response);   }) .fail(function(xhr) {         console.log(xhr);   });
  • Jquery UI autocomplete on dynamic fields

    Kindly have a look at this screen capture. http://www.screencast.com/t/GMGBy6QF9bP as i have shown i am trying to use jquery ui autocomplete on a dynamically generated fields, autocomplete works fine with the main field i'm using to copy & generate dynamic fields. but when adds a new field the autocomplete not working with the newly generated field. this is my autocomplete code $(function(){   $(".get-tasks").autocomplete({    source: baseurl+"job/job/get_tasks_autocomp",   }); }); I would like to
  • Is there no shorter/smarter way to add/overwrite CSS statements than with "css(....,....)" command?

    Occasionally I want to add/modify CSS statements of the currently loaded webpage. Lets say I want to add/overwrite the current CSS values with the following new CSS values: #container article > p { font-size: 16px !important; line-height: 16px !important; font-family: Verdana !important; width: 98% !important;  } As far as I know users have to write therefore in jQuery a difficult, non-intuitive, multiple tags command similar to $('#container article > p').css({ "font-size" : "16px", "line-height"
  • restrict date range entered through keyboard

    I am using jqueryUI's datepicker widget. It works well when restricting dates within minDate/maxDate range when picking date using mouse from the calendar. But I can still type in any date in the textbox. Is there any way to restrict the typed in date also according to the minDate/maxDate range?
  • Problems Using Ajax to update DB

    So here is the ajax code located in the startPublishing() function: streamId = randomToken $.ajax({                         type: "POST",                         url: "connUpdate.php",                         data: 'stream=' +streamId,                         success: function(response)                                 {                                         alert("Record updated");                                 }                 }); here is connUpdate.php <?php // Create connection $link =  mysqli_connect("localhost",
  • Get values from several inputs&select

    Hello jQ-People, I'm new in jQuery and for my study i want to make a webapp that send to DB BBQ recipe by a from. Client goal: Complete form to creat a BBQ recipe ! Client need to: add ingredient name (input)+ Measure (input) + unity of measure (select) Client can: add several line of ingredient, each line is 1 ingredient My problem: I want to get in an array (for exemple) each line of ingredient like Arr [ "Apple", "3", "Kg" "Beef", "500", "gr" .... ] My goal send the objet to the database. I have
  • ajax by multiple row

    hi , sorry for english , i use thi example https://bootsnipp.com/snippets/402bQ and i create my own code https://jsfiddle.net/xpwh1oc5/  I have two answer : 1 if i change code with [value] the ajax dont work :                 <label class='col-lg-3 control-label'>Inserisci nome dropbox</label>                 <input type="text" id="ricerca_codice_lavorazione[0]" style="color: black"> <button type="button" id="button_ricerca_lavorazione[0]" class="btn btn-info">Ricerca Codice</button>and ajax too
  • Mouseenter firing multiple times

    I'm trying to get a random image to appear on each new hover of a div. The images are coming from some JSON data. It's currently working, but the mouseenter function is firing when the mouse is still inside the div. Maybe the getJSON request is working each time the image is delivered? Is it possible to store the JSON data in an array, and access that array each time mouse enters? Any advice would be much appreciated :) My jQuery code looks like this:   $('#imagehover').on('mouseenter', function()
  • Problems with dropdown calendar in Safari

    I have been using a jquery work around for a datepicker which until today has been working perfectly. Suddenly, it has stopped functioning, so that the drop down calendar no longer appears. The code that I have used for the date picker is as follows: <script type="text/javascript">     var datefield=document.createElement("input");     datefield.setAttribute("type", "date");     if (datefield.type!="date"){ //if browser doesn't support input type="date", load files for jQuery UI Date Picker      
  • css problem. datepicker input box border missing and calculate button missing fill-in image.

    My datepicker works fine with my old css. but with my new css the little black lines that outline the date input box are not displayed and the calculate box is incomplete. Do you know how to make this right? http://kalamazooalanoclub.org/2019better.php *{     margin:0;     padding:0;     border:0; } #wrapper {     width: 790px;     margin: auto;     margin-top: 12px; } #header {     height: 140px;     background-image: url(logo.jpg); } #menu {     width: 200px;     float: left;     padding: 10px;
  • navigation link clicks hide/show button when loaded ajax loaded

    Hi, I currently have click functions for my navigation links to show and hide a button based on what is clicked but some pages load  (utilisation) loads via ajax and therefore I need to hide the button until it's loaded. Can anyone help me out here please? Thanks $( "#administration, #history, #vehiclereport, #plantreport, #trailers" ).click(function() { $(".btn-toolbar-image").hide(); }); $( "#fleet, #fuel, #improvingbehaviour, #safety, #report, #summary, #trend" ).click(function() { $(".btn-toolbar-image").show();
  • clone repeats multiple times if a class but works properly if an id

    Hi,  I am trying to clone some html after each driver-report-driver class name, this works fine if I target the name as an ID of report_topper_head but it repeats multiple times between if it targets a class of report_topper_head Problem is, I can't have the same ID name throughout my code $("#report").click(function() { $(".report_topper_head").clone().insertAfter(".driver-report-driver"); });
  • using singleton to replace $(this)

    Hi: I hope to implement an singleton to replace the usage of $(this); following is my code snippet             jQuery.single = (function (element) {                 var collection = jQuery([1]);                 return function (element) {                     collection[0] = element;                     return collection;                 };             });             $('#btnTestSingle').bind('click', function () {                 var html = jQuery.single(this).next().html();                 console.log(html);
  • Get top style from dynamic content

    I'm trying to get a top style that is being applied to dynamic added content and assign to an image. I've built a function w/ Timeout to check if it's parent exists and then get the css(top) value. It's firing now, but I can't assign the top style to the image margins. function addGalleryDone() {         var emarck = $('.justified-gallery .pro').first().find('img').css('margin-left');         if (($('.justified-gallery').length) && (emarck != '0px')) {           console.log('Galleryload Done');  
  • jquery 3.4 - Replacement examples for deprecated positional selectors (:first, :last...)

    Hello, On the 3.4 version, selectors ":first, :last, :eq, :even, :odd, :lt, :gt, and :nth" are marked as deprecated. http://blog.jquery.com/2019/04/10/jquery-3-4-0-released/ But I can't see anywhere examples of functions we should use instead... Can somebody point me out some doc on the subject, or give me some examples, please? For :first and :last, I can use .first() and .last(). But what if I want the opposite, with 'no'' ? Like: var $dom = $('input[name^="field_001_"]:not(:last)'); And what methods
  • toggle sibling

    Hi, I'm trying to show a ul when a h3 is clicked, below is the code I have, hope someone can help: <div class="footer-menus"> <div id="footer1"> <h3></h3> <ul> <li></li> </ul> </div> <div id="footer2"> <h3></h3> <ul> <li></li> </ul> </div> <div id="footer3"> <h3></h3> <ul> <li></li> </ul> </div> </div> <script type="text/javascript"> $(document).ready(function() { $('.footer-menus h3').click(function()
  • Uncaught TypeError: $(...).dialog is not a function error in jQuery3.3.1

    Hi JAKE, I have the following error appearing in my page using jQuery 3.3.1 Uncaught TypeError: $(...).dialog is not a function     at <anonymous>:1:14     at m (jquery.min.js)     at Re (jquery.min.js)     at jQuery.fn.init.append (jquery-3.3.1.min.js)     at jQuery.fn.init.<anonymous> (jquery-3.3.1.min.js)     at z (jquery-3.3.1.min.js)     at jQuery.fn.init.html (jquery-3.3.1.min.js)     at Object.<anonymous> (jquery-3.3.1.min.js)     at u (jquery-3.3.1.min.js?     at Object.fireWith [as resolveWith]
  • Javascript Afficher DIV Jquery

    Bonjour, Avez-vous une idée pour faire afficher ma DIV "Transparent" (Jquery) via ma fonction test() en javascript ? merci d'avance <!doctype html> <html> <head> <meta charset="utf-8"> <title>Example</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" /> <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
  • Ajax form does not execute on success

    Hi, I have a form that uses ajax. It is supposed to execute an addclass and append to a div upon success. The code submits the form, but does not execute on success. $("form#mc-embedded-subscribe-form").submit(function(e) { e.preventDefault(); $.ajax({ type: "POST", url: $(this).attr('action'), data: $(this).serialize(), // serializes the form's elements. success: function(data) { $('#newsletterform').addClass('success').append('<div class="thanks">Thanks for Subscribing!</div>'); } }); }); What's
  • Language switcher is not displaying in Firefox browser with jQuery 3.3.1

    Hello, I need your help on this, please. I have an application with  PHP, Javascript and jQuery. I have upgraded jQuery from 1.12 to jQuery 3.3.1 version using jQuery migrate plugin. After upgrade the menu worked fine(as I could tested it) but now menu is appearing randomly in Chrome and non displaying at all in Firefox. Debugging app, pausing on exceptions finds this error stack: SyntaxError: '*,:x' is not a valid selector php code: $languageswitcher = ''; if (LANGUAGE_SWITCH && empty($logoutontop)
  • Change calendar language

    Hello friend I really need to change the language of my panel but I've spent hours trying and I can not. Can someone please help? fullcalendar.js https://drive.google.com/open?id=1xktFUmkxgbzxLwVnCdZOFlsyHmmccPvW Page that loads calendar manage_holiday.php https://drive.google.com/open?id=1IL7eNKh1c7h_qQNGbzgC0zLB-HgvB3Ya
  • help with image

    Tìm hiểu về tương lai của tiền điện tử Tiền điện tử là một loại tiền tệ hiện đại, dù mới xuất hiện nhưng đã thu hút nhiều sự quan tâm của người tiêu dùng và giới chuyên gia tiền tệ. Tương lai của loại tiền này như thế nào vẫn còn là một dấu hỏi. Bài viết sẽ cung cấp một góc nhìn về tương lai của tiền điện tử. Tương lai của tiền điện tử như thế nào là vấn đề được nhiều người quan tâm. Mục đích ra đời của tiền điện tử Tiền điện tử hay tiền ảo là một loại tiền tệ hiện đại, được quản lý hoàn toàn dựa
  • jquery validation

    Hi my name is frank, I need help to solve a validation problem. as I fill up partially my form at the first ok field checking stops, leaving fields unchecked, also event.preventDefault myght be used in a wrong way, thank you, frank
  • 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