• Saving AJAX JSON to an array

    How do I save the JSON which I'm receiving through ajax to an existing array? I first need to delete everything in my array savedData and save the JSON into that. Here's the code :- function getArticleOnPageLoad() { $.getJSON("http://www.myurl.com/myJSON.json", function(data) { savedData = data; createData(); }).fail(function(error) { console.log("AJAX ERROR: " + error); }); }
  • how to chain a promise across js modules?

    I have a js module which calls another js module: /* InitModule */ //sets hdnMyUIWidget value to a defined template MustacheTemplateLoader.LoadMustacheTemplates(); //calls Mustache.to_html(template, date) UIBuilder.LoadMyUIWidget(); I'd say about 80% of the time the mustache template is available as expected in the hidden field by the time UIBuilder.LoadMyUIWidget() gets called. But 20% of the time it's not available.   So it seems that I need to figure out how to tie a dependency to start the execution
  • IE vs ajax PUT file upload (works in Chrome)

    Hi :)  The following works in Chrome but not in IE. Long story short: I'm trying to upload a binary file (used for firmware update) to a box running Lighttpd.    $.ajax("api/dupdate", {      method: "PUT",      contentType: "application/octet-stream",      processData: false,      data: dupdateFile,      success: function(data, status, jqxhr) {        console.log("OK!");      },      error: function(jqxhr, status) {        console.log("Error, status: " + status);      }    }); In IE when trying to
  • Regarding native code error

    Hi, I'm working on Highcharts and maps in ASP.net pages using jquery. When I run my application , at the time of navigating to another page in middle of current page, I'm getting "native code error". I have tried and google searched regarding this problem, I didn't get any solution. Could you please help me to eradicate this error Regards Venkateswari
  • Jquery Autocomplete displaying ID in a seperate text box

    Good Day  I am a total novice and trying to use autocomplete to display selected results in separate textboxes but I am totally lost. I need to capture the Full_Name and ID in the separate textboxes here is my current files asp file: <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeFile="SearchTest.aspx.cs" Inherits="SearchTest" %> <asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent"
  • Previous and Next buttons are getting hidden in all pages

    I've 2 pop-ups to display the user list & admin list which would display 10 results per page, which is working fine. I'm getting the page nos. from the java servlet in the JSON. Note: There are 2 parameters passed in the url - resType and pageNo. pageIndex returns 0, 10, 20 ...(multiples of 10). result: checks what sort of result I want. You can ignore this part.  So my url in the createTable function looks something like this instead -  ''/abc/myData.json?result="+resType+"&pageIndex="+pageNo In
  • disable the days in end datepicker based on start date

    hi, https://jsfiddle.net/uqo6q4gu/
  • Passing conditional referral code based on URL string and form selection

    How can we pass the appropriate referral code in the following scenario based on the URL string and color selected? Form select (Colors): Red Blue Black White Scenario 1: If user accesses page with a URL string that includes any CLR, such as testing.com/?CLR=somethingHere, then mktrfl="default" Scenario 2: If user accesses page with following URL string (testing.com/),  and selects "Red", then mktrfl="groupred" Scenario 3: If user accesses page with following URL string (testing.com/),  and selects
  • Enlarge Div on button click

    Hi, Is it possible to enlarge a div's height/width (from the exact middle of the div) when a button is clicked? Thanks
  • How to pass a value

    Hi  var Id; $('.btn.btn-danger').on('click', function () {         var Id = $(this).data('id');         // Here Id value is correct and i want to pass this value below click function });       $("#deleteConfirmModal").on('click', "#deleteConfirm", function () {         Id = Id;        // Here it is showing undefined        $.ajax({             url: '/test/Delete',             data: { 'id': Id },             type: 'POST',             dataType: 'json',             //data: xsrf,             //cache:
  • Uncaught Reference Error : jQuery is not defined in jquery-3.1.1

    I got a message Error in my project "Uncaught Reference Error: jQuery is not defined" I need help to fix that.  my project link: https://ufile.io/3vbk1
  • Block UI

    Hi,  I have the following, although the screen locks it does not seem to show the image, is there something I am missing. Also: 1. Is it possible to hook in to the DOM busy processing, such as scrolling a nested treeview? 2. Is it possible to add a delay prior to unlocking? $.extend({           initializeUiBlocking: function () {               if (typeof ($.blockUI) != 'undefined') {                   $.blockUI.defaults.css = { border: 'none', backgroundColor: 'transparent' }                   $.blockUI.defaults.message = '<img src="Images/ajax-loader.gif" />';
  • autocomplete (sending an additional parametr to server request)

    Hello! I'm trying to use autocomplete with data source from php. I need to make the request to my script with the 2 parametrs. getset.php?get=table&term=some But still don't understand how. I need to do something like this: $( "#autocomplete" ).autocomplete({     sourcel:'/getset.php',     params: {         'get': 'table'     }; }); But there is no params option in http://api.jqueryui.com/autocomplete/#option-source Could you help me to solve this problem?
  • ajax return is null

    I'm trying to get back confirmation that a file has been written to using php.  Here's a php code snippet: // Check that write has been successful   if ($fwrite !== false) {     $output = json_encode(array( // create JSON data       'type'=>'success',        'text' => 'Congratulations !  The key has been successfully created.'     ));     return ($output);     die($output); // exit script outputting son data   } This is my ajax sending stuff: // upload text to file   $.ajax({     method: 'POST',
  • Exporting string to file w/ double quotes

    I'm trying to write a string to variable & then write that to a file, but the quotes are coming in as &quot;  I've tried several things & not having success. Currently have this: var keystring = "$easydb->key=&quot;" + usersalt + "&quot;;"; Which yields the following string in the file:   $easydb->key=&quot;GN86rI4pZ5ggGGjp&quot;; I want it to end up as:  $easydb->key="GN86rI4pZ5ggGGjp"; So how do I write it to get those double quote to actually show in the file?
  • How to scroll in inactive page from code?

    I have multipage jQuery Mobile app. First page contains container div with number of child divs, which can be scrolled programmatically using .scrollLeft(...). Now when user navigates to second page and want to go back to first page, I need to scroll container programmatically before he can see first page. This doesn't happen, because container scrollWidth is 0, while the page with that container is not an active page. Question - how to scroll divs in inactive page from code? This is sample code
  • What are the steps to install unslider for WordPress?

    Hello everyone, I'm troubleshooting how to install a jQuery plugin called unslider. Unslider is a plugin that displays a slide show on your website. I never use jQuery before and after following the 4 steps on Unslider's website, I am unable to add the plugin to my website. Can you please provide me the complete steps (and pre-steps) to safely install this plugin to my WordPress website? Please click the "troubleshooting" link to see my previous steps. Cheers Brody James
  • Help with slider installation

    I am a newbie I need to install this slider (link below) into my lightbox urgently. The codes are available in the links. http://www.jqueryscript.net/demo/Clean-Flexible-jQuery-Content-Slider-Plugin-unslider/ http://www.jqueryscript.net/slider/Clean-Flexible-jQuery-Content-Slider-Plugin-unslider.html I contacted the lightbox and they told me to add the slider inside the <div class="wpb_wl_images"> How can this be done? Thank you!
  • Not Enough arguments error

    I'm getting a Not enough arguments error.  This script basically collects key/value pairs & gets them ready to be ajax'd to a .php handler file.  var obj_data = {};   obj_data['key'] = keystring;  // Ex. Keystring: $easydb->key="x2nrdIpAmdorqMj4";   var textData = new FormData();     $.each(obj_data, function(k, v) { // apply object key/values to formData console.log(['Key, Value: ', k, v]); textData.append(k, v);   });   $.ajax({     method: 'POST',     url: 'assetPath/easydbkeysetup.php',     data:
  • upload a file using jquery ajax function

    Hello again, I am trying to create a possibility for users to 1) select an image using an input field --> the image is displayed in a preview box by the function readURL --> that works fine 2) upload that image to process sever side wise by clicking a div calling a function uploadImage --> HERE IS THE PROBLEM The html code: <input type="file" id="imgInput" /> <div id="submitAddImage" class="messageBoxSubmitButton">Bild hinzuf&uuml;gen</div> No <form> tag around used. Also functions are called on
  • can see other pages at startup

    I have a single html file with lots of pages.  At startup I can see for a about a second the other pages in an unformatted layout then it shows the first page just fine. how do I prevent it from showing content from the other pages (that one second at startup). I tried adding display:none to all pages but that messes up the way jquery mobile works. doing that will make page changes always  hidden. any suggestions. thanks, Peter
  • AJAX sub-menu not working in DIV tab

    After I added the div tab, the AJAX sub-menu is not working anymore. I am stuck here for whole day. <div class="tab"> <button class="tablinks" onclick="openProgram(event, 'add_item')" id="defaultOpen">Add Item</button> <button class="tablinks" onclick="openProgram(event, 'list_item')">List Items</button> </div> <!--------------------------------------------------------------------------------------------------------------------------------> <div id="add_item" class="tabcontent"> <div id="list_item"
  • jQuery not working properly

    0down votefavorite Hello I have problem regarding jquery. Well the problem is, the input text value stays the same everytime. Instance: I click on the edit button and the customer details are populated using ajax. and then when I try to change for example the name of the customer, it submits the old value. it does not change. Here's my code. $(document).on('click','#editcustomer-btn-save',function(e) { var params = { id: $('#editcustomerform .customerid').val(), name : $('#fuck').val(), address :
  • Why different behaviors on Safari desktop / iphone and when application is added on Iphone desktop?

    Hello ! Could someone tell me why I have different behaviors on Safari desktop / iphone and when application is added on Iphone desktop? In my application I perform a calculation to adapt one value to be displayed: var Cal = 101;       /* (value normally retrieved from my db) */ var  G_DepEnerg = 2938.52 ; var PcCal = (Cal / (G_DepEnerg / 100)); var NumPCal = Math.round10(PcCal, -1); /* Using https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Math/round#Utiliser_Math.round()*/
  • How to remove <br>?

    Assume the following code <a class="foobar" ....>.....</a> <br> How do I remove the <br> tag following (all) <a> elements with class="foobar"? The following does not work: $("a.foobar").next().remove(); Why not? Peter
  • Autocomplete match beginning

    This is more a tip than anything else for someone like myself who has next to zero experience with the jQueryUI.  In using the Autocomplete widget I noticed that the first letter entered matched against ANY letter in the associated list of words. I thought this to be unconventional behavior. I think most users would want to see only the words that BEGIN with the letter(s) they typed.  At the very bottom of the jQueryUI API page on Autocomplete is an example for matching only the beginning of terms.
  • How to show, hide, or disable one header in a jQuery UI accordion widget?

    I'm building my first page using ANY jQuery UI. I have set up an Accordion Widget, and I would like to be able to hide or disable one of the lower headers in it based on some actions in an upper one. Also, to re-enable based on the same sort of thing. I know how to detect the action that should trigger this to fire a function, but I don't know how, within the jQuery UI system, to hide (with animation would be nice) or disable (with dimming or something would be nice, but not expandable in any case)
  • jsRender (client-side lightweight templates)

    This morning, I came across a blog post about jsRender:     http://www.htmlgoodies.com/beyond/javascript/display-json-data-using-the-jsrender-template-engine.html It's a lightweight template renderer that can be used with (or without) jQuery. https://github.com/BorisMoore/jsrender http://www.jsviews.com/ (try-it demo) Somehow, I hadn't heard of it before. I find it very attractive for my work. I write hybrid mobile apps using the Rhodes platform, and in Rhodes pages are (generally) produced from
  • Open Menu after append NOT WORKING

    Hello guys  I have this  <a href="#menu-toggle" class="btn btn-default" id="menu-toggle"></a> It is opening a side menu. But when i remove this code from html and append it with jquery like this:  $('.vertical-center').append('<a href="#menu-toggle" class="btn btn-default" id="menu-toggle"></a>'); it it not working. Can someone please help me ? It is urgent. I dont really understand why this happends.
  • Auto-complete with pre-populated data in an input box

    Hi, How do we go about doing jQuery UI autocomplete with an input box with some populated data? See below  <input type="text" name="myField" value="Some prepopulated data here," class="vest"> Notes: (1) The "Some prepopulated data here" is retrieved from a database via a query (2) The autocomplete list is supposed to show up when a user moves cursor into this field Outcome for the field would be: Some prepopulated data here, An Unmarried Woman if "An Unmarried Woman" is selected. $(function() { var
  • Help with jQuery Function needed

    I have a list view created using a 3rd party module in DNN called XMOD Pro. I want to update a single field in each row using AJAX and a "feed" so that I can refesh the value of "STATUS" from the database without the user having to refresh the entire page. (cant use ajax for full listing as need the links and edit facility in each row) I have created dynamic IDs on the elements I need to read from and write to. I have managed to create a function that iterates through the list and using alerts at
  • Tooltip positioning collision: flipfit not doing it's thing

    OK. So here's the deal. I'm pulling my hair out trying to figure this one out. When the user hovers over images, the tooltip sometimes shows up properly positioned and sometimes does this thing where half of it disappears beneath the boundary of the browser window: Then, as if to mock me, when the cursor leaves and re-hovers, the tooltip shows up properly on the exact same element.  It should at least be consistently wrong don't you think? First hover: maybe shows up properly Second hover: always
  • Change the attribute of a dyanamic element if it passes a condition

    I've a function 'refreshDisplay' which will help me create dynamic elements. Now, I've a small condition there. In the 'src' attribute of the image, I'm going to check if the obj.picture.thumbnail starts with '/content' then append  '.jpg'  to the end of the obj.picture.thumbnail's value , else just use obj.picture.thumbnails' value! Please check the image with class '.myLink' in the code. How do I achieve this? Here's the code. function refreshDisplay() { $('.container').html(''); savedData.forEach(function
  • How to make datepicker screen disappear upon selection?

    Intention: After a user selects a date via datepicker he/she continue to type something after the date.  Thus, it's very desirable to make the datepicker date selection screen disappear upon selection.  Doable?  The doc is not obvious on this.  If so, how?   Thanks. <input type="text" name="myField" size="115" class="gdateComma">  (function() {   var d = new Date(); var maxD = new Date(d.setDate(d.getDate()));  $('.gdateComma').datepicker({changeMonth: true,changeYear: true,yearRange: "-31:+0",maxDate:maxD,dateFormat:
  • jQuery CSRF issue on jQuery.get(...)

    HPE Fortify Static code analysis flags the below lines as a CSRF issue in all versions of jQuery. return jQuery.get( url, undefined, callback, "script" ); return jQuery.get( url, data, callback, "json" ); Ref: 1 & 2 Fortify issue description: The HTTP request at jquery-3.2.1.js line 9307 must contain a user-specific secret in order to prevent an attacker from making unauthorized requests. Are there solutions to mitigate this issue?
  • Setting heigh size for a sidebar which matches the main content heigh size

    Hey there guys. For several hours I'm trying to set the heigh my private wiki's sidebar so it matches the main content's size. Sadly I can only handle with CSS and HTML and I'm trying how to handle with JS, PHP and jQuery. What's why I am here to ask you guys to help me. We're using a Wordpress-like skin, which can be downloaded on mediawiki.org. I modified our skin called "Dusktodawn", fixed several table issues within the wiki (made by the skin) and I'm nearly done with my work. Like I said in
  • Modal / Pop up using Jquery

    I am working on a modal / pop up. On clicking an anchor tag I need to Open a modal/pop up. In the modal/pop up, Prompt the user to enter a start date, add 1 year to the start date entered by the user to display an end date, match that end date to the current date and display a message whether the end date is expired or is still active. Can I get a working example for this.
  • LightBox

    By using any free jQuery framework. I need that on clicking an anchor tag Open a gallery of images in a lightbox . Use a modern lightbox which has swipe functionality on mobile.
  • Can datepicker return just year?

    If so, and then I'd like to get a list of the values of the past 5 years.  Thanks.
  • Disable the previous button in the first page

    I've a pop-up to display the user list which would display 10 results per page, which is working fine. I'm getting the page nos. from the java servlet in the JSON.  How do I disable the previous button, when it is the first page? Likewise, how do I disable the last button, when it is the last page? Here's my code. function UserList(pageNo) { var resType="userList"; getResults(resType,pageNo); $(document).on('click', '.next-btn', function(){ var next = 10+pageNo; UserList(next); }); $(document).on('click',
  • 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