• here document.write function is not working can anybody help me to fix this plz......

    <!doctype html> <html lang="en"> <head>   <script src="https://code.jquery.com/jquery-1.10.2.js"></script> </head> <body> <table> <tbody> </tbody> <script> $(document).ready(function(){ var arr = [ [2,3,4,5,6], [3,2,3,4,5] ];     $.each( arr, function(index,value) { document.write("<tr>");         $.each(value, function(key,value){           $( "tbody").append("<td>" + value + "</td>");        });        document.write("</tr>");         });     }); </script>  </table> </body> </html>
  • jQuery Validation Plugin doesn't work with pretty URLs

    Hi there clever people I seem to have encountered what I think is a bug with the JQuery Validation Plugin (from jqueryvalidation.org), though it could also be due to my own ineptitude in this area, so any help would be appreciated. When you type an invalid email address in the email field of a form using the jQuery Validation Plugin, and then move focus to another field, it is supposed to show an error under the email field.  It works as expected when the URL looks like this in the browser: thanom.com/contact.php
  • Uncaught TypeError: $(...).modal is not a function

    Hello Everyone,  I am using jquery in react and i am facing this issue. My code is showFileUploadModal(roleType){     console.log(roleType);     $('#fileUploadModal').modal('show');   } showFileUploadModal get triggers by a button. I put $ in watcher and i did not find any modal function there, what should i do? I am using jquery v3.2.1 how can i overcome this error?
  • setInterval with a function PARAMETER of global variable not working

    https://jsfiddle.net/jsfiddle135/xpvt214o/956977/ Symptom: setInterval works fine with a global variable WITHOUT ANY parameter.                  But with a function parameter, the global variable is not passed as a function                   parameter. ------------------------- $(document).ready(function(){         var str; str=""; var num;     function display(num){   // NOT WORKING function display(){   // Fine     num++;     str=str+num $("#textid").text(str); } setInterval(display, 1000, num);  //
  • How to delete all text following an element?

    Assume the following simplified code: <div class="aaa" ....> .... </div> sometext .... How can I delete all text following the element(s) with the class "aaa"? When I write $(".aaa"):nextAll().remove(); then the text is NOT referenced/removed since nextAll() resp remove()  address only elements but not simple text. How else does this work? Peter
  • JQuery mask erases the last character of an input element masked to ip address

    I am using the jquery.mask to format an input with ip address. See the code below: window.jQuery('.ip-component').mask('099.099.099.099'); The problem is that when I enter a ip address like this "010.230.230.6" (it's a valid ip address) and change focus to another element, the value of input element changes to "010.230.230", it erases the last character. I have the mask keep the value and check it as a valid value.
  • listen to Click event on dynamically added elements

    I dynamically add some elements to an existing element, but I can't get the Click event to work on the dynamically added elements. I've worked with similarly scenarios before and using ON has always worked, but not now. Function: function SetStars(count) {     console.log("SetStars (" + count + ")");     var $stars = $createWrap.find(".score-wrap > .stars");     $stars.empty();     for (let i = 1; i <= 5; i++) {         let $elm = document.createElement("i");         $($elm).addClass("fa-star").addClass("star").addClass("clickable");
  • During an $.ajax call some data is lost

    Hello, I have a form with a multiple select box. When I select more than one option and send the form via an ajax cal to a php file, only the last option will be saved. Why is that so? This is the AJAX call: var daten = $('#formulargesamt').serialize(); console.log(daten); $.ajax({ url: "/ajax/neukundenanlage/get_formular.php", data: daten, method: "POST", }); n the console.log prompt all data is there (as a string). However in the PHP file it is an array with only the last selected option. Does
  • jQuery Ajax Abort On Timeout - Strange Behaviour

    Hi, I have been battling with a strange problem with the latest version of jQuery. When I run a $.ajax, and give a timeout, I can see the timeout value works in that chrome / firefox shows the xhr request as being cancelled after the timeout period. The problem I have is, subsequent ajax calls to the same domain, from that browser all get stuck in Pending state after the first one timed out. Running them in a seperate browser is fine. They only stick in pending in the original browser until I either
  • Differences in similar remove() calls

    What's the difference in the following two lines? $c.find("script").remove(); and $c.remove("script"); ...where $c is a jQuery object representing a large div (there is a difference in behaviour)
  • Help/Review how to write modular Jquery code

    I tried to write a modular Jquery code as this https://learn.jquery.com/code-organization/concepts/ said. Can anyone review my code and give me advises to improve it? Is there a better way to do the fetch operations than I am doing? Can I expose only the `init` methods as a public API? class SearchVenues {     constructor() {       this.categoriesSelector = $('#catgories');       this.distanceSelector = $('#venue-distance');       this.state = {         category_ids: [],         distance: null  
  • Allow parent scrolling when using jquery ui .draggable()

    Hi there! I have an annoying problem. I'm using jquery draggable on a set of divs and i'm restricting movement to the y-axis. My problem is that my parent div (using overflow-x:auto) cannot side scroll anymore. Do you have any ideas? Thanks. $(".openApp").draggable({axis:"y",                         drag: function(e, ui) {                             console.log(ui.position.top+" dd")                             if (ui.position.top > 0) {                                 ui.position.top = 0      
  • How to select/assign values to element in modal from calling page

    In the index page, I have a div that serves as the modal container: <div class="modal" id="edit-document">         <div id="edit-document-container"></div>     </div> On this page, I have a drop area that will accept files: <div id="fileUploadDropZone">         <input type="file" name="formlessUpload" id="formlessUpload" class="inputfile" multiple />         <p id="fds">Click/Drop Files Here</p>  </div> And some CSS to make the area a drop area:  #fileUploadDropZone {     width: 100%;     height:
  • Jquery sortable not giving current sorted positions

    I am using jquery sortable lib. The problem I am having is that $(this).sortable('serialize') not giving the current item position after sorting it in UI. Can anyone look into this jsbin example and help me to figure out what is wrong? HTML  <div class="wrapper">     <p id="foo_1"><div><span>foo</span>1000</div></p>     <p id="foo_2"><div><span>foo</span>2000</div></p>     <p id="foo_3"><div><span>foo</span>3000</div></p>     <p id="foo_4"><div><span>foo</span>5000</div></p>   </div JS $(function()
  • How do I implement jkeyboard?

    I have an application that needs an on-screen keyboard.  I found one here: http://javidan.github.io/jkeyboard/examples/index.htm I have a three implementation questions. 1. How do I implement a <Tab> key?  I want to have more than one input field, and I want the <Tab> key on the keyboard to jump the focus between input fields. 2. Once the <Tab> key is in place, how do I get the plug-in to type into a given input field?  For example, I have the following: <form action="/action_page.php">   SSID: <input
  • I cannot get my questionaire to execute a function when the wrong answer is chose.

    When you click on the wrong answer and then hit next, the function does nothing, as it is supposed to either go to the next question or generate a wrong answer modal. Can someone please help and tell me where my code is wrong. $(document).ready(function() {   $(".begin").click(function() {     $("#main").hide();     return quiz();   });   function startOver() {     location.reload(true);   }   function quiz() {     var score = [];     var questions = [{       q: "How many years did the original Twilight
  • grab selected table row data (skip first td element) before deleting

    Hi all I am following some tutorials and working on this one right now : https://www.tutorialrepublic.com/codelab.php?topic=faq&file=jquery-append-and-remove-table-row-dynamically I would like to grab selected table row data (skip first td element) before deleting the selected row. $(".delete-row").click(function(){             $("table tbody").find('input[name="record"]').each(function(){                 if($(this).is(":checked")){                     $(this).parents("tr").remove();                
  • Jquery UI Drag and Drop Issue

    Hello, I have issue with jquery drag and drop. While dragging one element, two dropable area selected that I need to prevent it. How can I prevent it?
  • Doubts about ajax

    Hello everyone ! My name is Taniguchi am im new at jquery. im developing a jquery code to get latitude and longitude from bing map rest service, i already have the code but i have trouble to understand part of it. function getcordinate(executionContext){ var attribute = executionContext.getEventSource(); var Rua = atribute.getvalue; var proxy = 'https://cors-anywhere.herokuapp.com/'; var bingURL = "http://dev.virtualearth.net/REST/v1/Locations/BR/query='" + Rua + "'&key=AlBxRwA5l41uHKOuC8_cNHwnAe8trlfDFqr5h-O7iz_jCPGaIuW4RhZZhMjOCj8C";
  • JSON file content assignment to global variable

    Hi jQuery Forum Users, I encountered a problem, when trying to assign a json file content to a global variable. A short explanation - There is a file called test.json with some json content, which shall be assigned to a global variable using jQuery. For this purpose, I am using XMLHttpRequest. A defined function loadJSON calls XMLHttpRequest, with a callback function handling the json file content after a successful request. But the json file content is only available within the callback function
  • How must I compare array field in jquery?

    I have a jquery script as: <script type="text/javascript">         $(function () {             $("#table").DataTable();             $( "#table_content" ).sortable({               items: "tr",               cursor: 'move',               opacity: 0.6,               update: function() {                   sendOrderToServer();               }             });             function sendOrderToServer() {               var order_menu = [];               $('tr.row1').each(function(index,element) {          
  • FORMATT LISTVIEW

    Hello I would like to format a dynamic listview with multiple lines. in the example I can enter only 3 lines but I would like to add more. How can I reduce the space around the writing
  • Content selection custom attributes

    I am trying to extract the value JHON DOE from this span tag and I am unable to figure out how to do this without a brute force of searching for each element and doing a manual string match. Any thoughts? Thanks Ivan  <span data-bind='text: pname()'>JHON DOE</span>
  • Not Able yo Add Previous Function(Slide Back) to Simple jQuery Slider

    Can you please take a look at this demo and let me know how I can enable previous button to slide to? as you can see the next button is working fine but I am not able to slide back $("#slideshow > div:gt(0)").hide(); $("#next").on("click", function(){ $('#slideshow > div:first') .fadeOut(1000) .next() .fadeIn(1000) .end() .appendTo('#slideshow'); }); $("#prev").on("click", function(){ $('#slideshow > div:prev') .fadeOut(1000) .next() .fadeIn(1000) .end() .appendTo('#slideshow'); }); <button id="next">
  • Sortable plugin is not working i don't know what mistake i have made can some one please help me?

    <!DOCTYPE html> <html> <head>    <link href="https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet">      <script src="https://code.jquery.com/jquery-1.10.2.js"></script>      <script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>      <script type="text/javascript">       $(function() {            $(".rightItems").sortable();       });     </script>     <style type="text/css">        .leftItems{    text-align:center;    border:1px solid red;    background-color:red;
  • Setting a class on mobileinit.

    In the data-role="header" is it possible to set .ui-alt-icon once in the mobileinit function like you can pageTransitions etc. Thanks,
  • JQuery plugin not working on RPi 3

    I *THINK* this may be a JQuery plugin issue, but I am not certain.  I have a Raspberry Pi 3 running java 1.8.0_65, apache 2.4.25, and chromium-browser 60.0.3112.89 under Raspbian 9.4, and I am having some trouble with some javascript served from a CGI script. I have never in my life worked with javascript, and I am no expert with HTML or CGI, so am a little lost, here. I can bring up the following URL: http://javidan.github.io/jkeyboard/examples/index.htm which contains the references: <link rel="stylesheet"
  • how to calculate a total based on type

    Hi everyone      I have a html table that the rows are added dynamically and there is a column Type where the user inputs the following values from a drop down combo box : Ncc Regular code what I would like to do get the sum for every type for ex. the sum of Regular the sum of Ncc I  been on this for days and cannot figure out  how to do this below is a picture of the table 
  • Changing the data-icon colour from white to black?

    Hi, is it possible to change the CSS so that I can change the colour of the icons (data-icons) from white to black? I have tried looking through the code but cannot find out how? Thanks.
  • How can I turn off two videos via an external button html 5

    I tried to place this code, but the buttons only play one video <!DOCTYPE html>  <html>  <body>  <button onclick="playVid()" type="button">Play Video</button> <button onclick="pauseVid()" type="button">Pause Video</button><br>  <video id="09876" width="320" height="176">   <source src="mov_bbb.mp4" type="video/mp4">   Your browser does not support HTML5 video. </video> <script>  var vid = document.getElementById("09876");  function playVid() {      vid.play();  }  function pauseVid() {      vid.pause(); 
  • Floating Labels for Select Dropdown

    I am using this code which returns "undefined" for the label of Select Boxes. This is because presumably the placeholder attribute is not supported for select elements.  (function($) {   'use strict';   $.fn.jvFloat = function () {     return this.filter('input:not([type=submit]), textarea, select').each(function() {       function getPlaceholderText($el) {         var text = $el.attr('placeholder');         if (typeof text == 'undefined') {             text = $el.attr('title');         }        
  • Gaining the eq() inside a div.

    Hi, I have included a fiddle but I want to know how I can return the eq() of a class in a particular div. For example when the user clicks on a team name it returns the eq() of the class (in this case club) from the parent <div> it is contained in.. So if the use clicks on Manchester  City, it returns 1 as would Wolverhampton as both are are in different containers with a different id. Here is the fiddle: https://jsfiddle.net/a4poster/xpvt214o/932775/ Thanks in advance.
  • ListView Master detail

    Hello I'm a beginner. I wanted a working example of a listview type master and detail with data loaded from the websql database. Thank you
  • Browser autofill not working on dynamically appended DOM element

    I am using jquery modal plugin to raise modal forms on a page. If I make the modal form visible on page load (as a test, and not yet raised by the plugin), the browser's autofill functionality works fine in the input fields. But, when I raise the modal form using jquerymodal (it detaches then appends the modal element to the body) the autofill no longer works. Any idea as to why? I thought it might have to do with the fact that the form code is inside <form> tags on the page, but when the jquery
  • setTimout and dialog.close with jquery after return message

    I have an email submission modal and everything works fine. It grabs the data, PHP processes the data and sends an email and then gives the success message back to the script then the script display "thank you for submitting. blah blah blah." After that I'm trying to use setTimeout to close that final message but it isn't working. Here's the code that finishes the email submission: if (data.responseText !== ' ') {       $(#emailModal).text(data.responseText);       setTimeout(function(){ $('#emailModal').dialog('close')},
  • jQuery UI Slider: generate knob onMouseDown and onMouseUp

    I've been experimenting with that library and I really liked it. However, I've been searching through their documentation twice from top to bottom and haven't found the method that I need. Basically, at the start, all I have is an empty slider (div or input with CSS), without knobs on them. When I click on that element, I need to generate the min value knob and when I release the mouse click, I want to generate second knob (max value) on that slider/element. Yes, two knobs. Min value and max value.
  • combine 2 files

    can anyone help me to make my registation form work with 2 different js files,  1-- register.js (the file responsible of animation and validation)  2--hashform.js (the file responsible of hashing the email, username and specially the password).--->this file is called when we click the submit button on the form. --> onclick="return regformhash(this.form,                                    this.form.username,                                    this.form.email,                                    this.form.password);"
  • Number of digits displayed in a slider's label suddenly changes

    I would like to understand why, for the second slider but not the first, when the slider reaches the top the value displayed suddenly shows many digits after the decimal point instead of just showing tenths (which is what I want). Thanks for edifying me. <!doctype html> <html lang="en"> <head> <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.3/themes/south-street/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-2.1.3.min.js"></script> <script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
  • JQuery UI Slider Concept

    I have an idea for a slider that maybe someone could help me with. I recently negotiated my salary for a new company and offer. They asked what do I want so I listed everything. Base salary Annual bonus Car Housing Food Transportation Stocks Mobile support Gym membership Education courses I want to make a slider of my ideal values for each item. And when the manager slides the base salary to a lower position then the others will adjust accordingly (higher value) so that I always end up with my ideal
  • Count the number of elements within specfic div

    Hi there, I have following code <div id="car_0>       <div class="card">              <input id="Max.Index" value="0">       </div>       <div class="card">              <input id="Max.Index" value="1">       </div> </div> <div id="car_1>       <div class="card">           <input id="Max.Index" value="0">       </div> <div> How do I count the number of Max.Index inside each <div id="car_x>? Joe
  • 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