• How to access data in callback function?

    My problem is that I want to hit an external api with an asynch callback function in a loop, and I need access to the loop index in that callback function. In this case the external api is the Google Directions Service, but that really isn't the key point; could be any api whose signatures I can't control. Anyway, my jQuery skills are only at the advanced beginner/intermediate level, but I managed to read up on the jQuery Deferred object and create code that serializes the asynch calls to Google's
  • Not showing images in url rewrite in htaccess

    I have to rewrite url (http://localhost/abcd/subcata.php?id=23&title=building) to (http://localhost/abcd/31/buildings) I have done rewrite rule with the following code but other extension files like images, css are not accessing. Images are located in (images) folder, What i do to show the images or attached css files. thanks in advance RewriteEngine On RewriteRule ^(.*)/(.*)\/$ http://localhost/abcd/subcata.php?id=$1&title=$2 [NC,L]
  • When we should use $(document).ready(function(){ in our jquery program?

    Hi <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery.each demo</title> <style> div { color: blue; } div#five { color: red; } </style> <script src="jquery-1.11.0.min.js"></script> </head> <body> <div id="one"></div> <div id="two"></div> <div id="three"></div> <div id="four"></div> <div id="five"></div> <script> var arr = [ "one", "two", "three", "four", "five" ]; var obj = { one: 1, two: 2, three: 3, four: 4, five: 5 }; jQuery.each( arr, function( i, val ) { $( "#" + val
  • jquery tabs

    Hello, i developed an application to test webservices and return a json code and i put it in new tab of (.ui-nav-tab). when i select the webservice, a new tab will be created with json code in the content-tab. But i have a big problem !! when i add a new tab, the content of the previous tab become empty. Can you help me please. i have a short deadline.
  • Access new appended DOM element

    Hello there, I'm trying to create a form with an undefined number of elements. It's in a table, the "add" capability came from a choice, and I want to insert the new element (my "test" row actually) just before the 'adder' element (created with jQuery). So my actual code is: jQuery(function($){     $("input[name='ptype']").change(function() {         var adder = document.createElement('tr');         adder.setAttribute('id', 'adder_1_1');         adder.innerHTML = '<td class="trow1">Add :</td><td
  • Issue on Updating jQuery setTimeout()

    I am trying to make a simple plugin to calculate date and time by this code: <div id="timer"></div> $.fn.timeCounter = function(time) {          var target = new Date(time); var now = new Date(); var timeDiff = target.getTime() - now.getTime(); if (timeDiff <= 0) {         clearTimeout(timer);     } var seconds = Math.floor(timeDiff / 1000); var minutes = Math.floor(seconds / 60); var hours = Math.floor(minutes / 60); var days = Math.floor(hours / 24); hours %= 24;     minutes %= 60;     seconds
  • checkbox handler not working

    I have a very simple setup but for some reason, the event handler for a checkbox is not firing. first my php outputs a bunch of check box options based on admin input in the back-end. The result outputs checkboxes like so: <div class="span2">       <input type="checkbox" name="Veg" value="BLACK OLIVES">BLACK OLIVE </div>My javascript file is also super simple and I can see it in the inspector being loaded.  $(":checkbox").change(function () { alert( "Handler for .change() called." ); });Not exactly
  • making data available outside the doc.ready function

    I am building an app using backbone....the backbone code is enclosed in the familiar document.ready function. And the file where this code is located is imported(with the usual method in the header of a page) in a PHP script. What I am trying to do is a variable that is inside the document.ready function,I want to make it available in the PHP script....an example will illustrate the case I think. $(document).ready(function() { var john='45' }); <?php   <div id="test">   document.write(john); </script></div>
  • JQUERY plugin for Ajax request , table sorter and pagination

    In one of my application I am using JQUERY table sorter plugin and it's addon pager also to do pagination. To use this initially I am querying database which contains huge data. Once it is queried then I am looping through the query and display in front end. Then I am applying JQUERY table sorter and pager. Now columns are sorting properly and pagination is also working. My problem is as it is a huge query I may get time out error and hence table sorter and pagination will not work. As a work around
  • How "$(selector).each()" function is working in jquery?

    Hi Here is the code : <!DOCTYPE html> <html> <script src="jquery-1.11.0.min.js"> </script> <body> <table id = "myTable" style="width:300px"> <tr>   <td>Jill</td>   <td>Smith</td>          <td>5</td> </tr> <tr>   <td>Eve</td>   <td>Jackson</td>          <td>5</td> </tr> <tr>   <td>John</td>   <td>Doe</td>          <td>11</td> </tr> </table> <script> $(document).ready(function(){ $('td:last-child').each(function(i) { $(this).html((function A(n) {if (n==1)   return 1;   else   return n*A(n-1)})( $(this).html()
  • Triger "function" after scrolling by an element. [Solved]

    Dear JQuery Forum UsersHi, I'm trying to execute an "animation" when the user passes by(scrolling) a specific element( e.g.: "div" ). After trying many online tutorials and solutions about that I still haven't find something that fits for what I'm looking for. Could anybody suggest me something? (If you want me to post some of the code that I've already tried, Please inform me) Thanks a lot, -Pain-
  • JQuery UI autocomplete, Load all Data in DOM instead taking from mysql DB

    Reason: Want to speedup autocoplete result What i have: I am having two Input boxes. One is Category and another one is Variety. First im selecting Category by, $("#category").autocomplete({ autoFocus: true, source: function(request, response) { $.getJSON("./php/autocompletenontex_getcategory.php", { category: request.term }, response); }, minLength: 0, select: function( event, ui ) { $('#variety').focus(); } }).focus(function() { $(this).autocomplete("search", ""); }); The above code shows autocomplete
  • Problem Playing Live Streaming Radio on Mobile Browser

    Hello Everyone, I am just starting to learn Jquery Mobile. I am creating a Mobile application for an Online Radio Streaming application for a FM Station. They have a streaming server and has been using it on their website. I have added the following code in jquery mobile application: <audio id="idRadio" preload="auto" controls="controls" src="http://192.190.84.25:9974/;stream.nsv&provider=required_file.swf&volume=100&autostart=true"> </audio> The problem is, When I browse the page in PC the audio
  • Passing parameters to url

    Hi, I am new to javascript and jquery but found it very useful for what I am trying to do. I found a sample code online, which uses jqGrid with local data: http://jsfiddle.net/hE2GB/. I have added a line "url: 'api/editSelection'" similar to the example code below to editsettings {} on line 114. My question is: How do I pass dynamic parameters to a url i.e. within the function below instead of zipcode = 97201, I'd want to use an array element zipcode = grid[0].p.selrow? $.ajax({ url: "/api/getWeather",
  • please assist with an easier way to call a function

    I have an image which on hover a div appears below the image. The problem is I don't know the easiest way to handle the functionality for multiple images. Right now all of the images have the same class (item) so the hover effect occurs on all the images at the same time, and I only want the effect to occur when hovering over each image individually. The CSS code is: .VFP a:link, .VFP a:visited, .VFP a:active{ color:#fff; opacity:.5; text-decoration:none; } .VFP a:hover{ color:#fff; text-decoration:none;
  • I am unable to add the content value in Jquery Panel

    Index.js ***************************** jQuery('body').layout({                                                                 north: {                                 paneSelector:            ".north"                             ,    size:                    "auto"        // eg: "auto", "30%", .30, 200                             ,    resizerCursor:            "n-resize"    // custom = url(myCursor.cur)                             ,    customHotkey:            "north_key"            // EITHER a
  • JQuery .load() only working in safari

    Hi there, I'm trying to load in an external href into a div on my webpage and then apply CSS to it. I am using JQuery .load() to load in the html and it works great in safari and my CSS applys to it. But when I open it using Chrome, Firefox or IE it doesn't load the html into the div. I was wondering if there are any other solutions for doing this?  I've read in places you've got to change your settings using terminal but that is not an ideal solution to an average user. Hopefully someone can help
  • find value of cell value using jquery

    Hi I want to find the value of above cell in a grid view using jquery i tried following code if ($.trim(cellText) == "0") { $(this).css('background-color', 'Red'); var $this = $(this); var $tr = $this.parent(); var col = $tr.children().index($this); alert(col); } above code returns only index value . ineed the value of that cell how to find out regards Baiju
  • This is the code Im working with, the problem here is i should get content from server and show it in Dynamically created Div and php pages are working correctly

    $(document).ready(function(){ $(function() { $('#custom_timings_section, #custom_timings_section1').attr('disabled','true');      $('#change_timings').change(function(){         if($('#change_timings').val() == 'custom_timings_select') {             $('#custom_timings_section, #custom_timings_section1').removeAttr('disabled');          } else {             $('#custom_timings_section, #custom_timings_section1').attr('disabled','disabled');          }      }); }); $("#addcategory").click(function ()
  • Why not use SVG sprites?

    Hi I am new to JQM, doing markup/CSS work on a project.  Looking into the way JQM deals with icons a question came up: What where the reasons for going with base64 encoded images instead of a sprite? According to this article the images appear significantly slower (apart from not beeing cached): http://www.mobify.com/blog/base64-does-not-impact-data-uri-performance/ so I was just wondering what is the gain... Thanks 
  • JQM theming and themeroler: More button variants

    Hi, I am new to JQM, doing markup/CSS on a project. In my research I bumped several times in to urgent recommendation to use the themeroler as a best practice.  But the themeroler seems very limited to me. Mainly because, since allmost everything is a button (selects, buttons, collapsibles), if I want to styles these differently, I need to create a new swatch for each. That seems very inefficient. Am I missing out on something or is the themeroler not really the way to go?
  • ajax response not comes in ajax form submition with jquery validation

    My code is this in which form submition is working throgh ajax with jquery form validation but response not working.. my ajax code : $("#save_form4").validate({ rules: { name: { required: true }, min_salary:{ required: true, number: true } }, messages: { name: { required: "Job Title is required." }, min_salary:{ required: "Min Salary is required.", number: "Enter Valid Amount." } }, // the errorPlacement has to take the table layout into account errorPlacement: function(error, element) { if ( element.is(":radio")
  • grid Column freeze in asp.net

    hi, I want to freeze the column in the more than 3 gridview in asp.net. for example first grid 2 column, 2nd  gridview 2 column, 3rd gridview 3 column and one more thing  i want freeze column in the horizontal only but we need to scroll vertically... 
  • Can not load custom JS added on custom master page of sharepoint online, on MDS Enabled site

    I have created custom master page and added custom js to that master page using scriptlink tag.But once MDS feature is enabled on site, master page can not load custom js, it gives js load error on the same page.                    Regards,          Amarja
  • I am having trouble calling focus() on a JQuery EasyUI plugin for the combobox; how do I do this?

    I am having trouble calling focus() on a JQuery EasyUI plugin for the combobox; how do I do this?
  • cycle2 issue

    Hi, I have two main div's rightDIV and leftDIV, in the leftDIV I have a Listbox control that list categories, when user click a category I make an AJAX call to server, get the images and start cycle using cycle2. This works fine.  When I select a different category I get an error saying -  "JavaScript runtime error: Unable to get property 'slideCount' of undefined or null reference" Any idea why ?
  • ajax ruins .each or .wrapAll (jQuery 1.7)

    I have a list of (Drupal) teasers that have a read more link after each one, and separate divs of the full complete text I need to show when the read more link is clicked, following the links. Here's the JS: $('.comment-teaser').each(function(){ $(this).next('a.read-more-link').andSelf().wrapAll('<div class="teaser-n-link"/>'); }); $('a.read-more-link').live("click",function(e) { e.preventDefault(); $(this).parent('.teaser-n-link').slideUp(400,function(){ $(this).parent().parent().find('.show-text').slideDown(400);
  • jQuery.extend is not a copy for Object!!!

          var A = {       info:{             name:'a'       }       };       var B = extend({}, A);       B.info.name='b';       console.log(A); // A.info.name  is change to b
  • How to use jQuery in Refresh Monkey? (Chrome plugin)

    Hi all friends. Sorry for my bad English. I am using Google Translate. My question is this: I installed a plugin for Chrome called "Refresh Monkey". Monitor websites and warns you when the content changes. This is a screenshot of the plugin: As you can see where I marked in red, tells me to receive notices of specific things I need to put "jQuery commands." By giving "jQuery" sends me to this website: http://api.jquery.com/category/selectors/ Here I appear "command line". I do not know what to do
  • number of rows inside a div using jquery

    Hi Guys, I wanted to find number of rows used inside a div. I used below code but it is not working. Jquery Code ===========     $(function() {     var addDiv = $('#bkup_docs');     var i = $('#bkup_docs tr').length + 1;     alert(i);      }); HTML ====     <div id="bkup_docs">     <tr>     <td align="right"></td>     </tr>     <tr>     <td>&nbsp;</td>     </tr>     </div> Here I am getting output as 1,actually it should be two. AM I missing something or I cannot do like this. Your help is well appreciated.
  • Datepicker: maxDate and specific end date?

    I want to set the datepicker to allow 90 days from now (maxDate:'+90d') but for that to not exceed Dec 31st. Is this possible? Thanks
  • first / last page and zoom

    Hi everyone,   I have a webpage: http://goo.gl/36bcwm   I want to add first / last page and zoom button to the web page to read book easily. I don' t know how can I add them? Could you help me, please?   Thanks for your help   Regards    
  • Issue with jQuery Mobile Documentation

    It seems that the directory for the Transitions documentation has been replaced with the directory of its parent. Go to:  http://demos.jquerymobile.com/1.4.2/ and attempt to click on the Transitions link on the bottom of the sidebar. It takes you to the same page that you were already on, but the url now reads: http://demos.jquerymobile.com/1.4.2/transitions If you click transitions again, you get a 404. It seems that the directory for the 1.4.2 Demo was copied into the Transitions directory and
  • JQM offline search feature

    ability to search pages and get results in JQM phonegapped app. I created a app that allows a user to see a training manual. Wanted to know if a search feature can be added that will work offline. User would like to search various words and have a results page.   i am new to JQM (4 weeks) This is the only thing so far that has me stumped.   Thanks   Griff
  • Trying to Use Cycle 2

    Hi, I am trying to run the Cycle2 jquery plug in.I am using wordpress. Here is my code: <script type="text/javascript" src="http://traviedigital.com/wp-includes/js/jquery/jquery-1.11.1.min.js">/script> <script type="text/javascript" src="http://traviedigital.com/wp-includes/js/jquery/jquery.cycle2.min.js">/scipt> <script type="text/javascript"> $(document).ready(function(){ $('#myslides').cycle() }); </script> this is placed in my header inside the <head> tags and before the php call for the head
  • How to call iframe parent function using jquery?

    Hi, I'm after something like this - only working :) jQuery('#ilightbox').top.myfunction(); Can Somebody help me pleaes?
  • submitting individual tabs in jquery tab

    With jquery tabs that have 2 tabs, is there a way to have a submit button in each tab and when clicked, only data pertaining to that tab is picked up and how would I know which submit function to call?
  • Open external webinterface inside a JQM page

    I want to load an external webinterface from my HTPC inside a JQM page. The webinterface was build with JQM. If it's possible, could somebody explain me how to do it? thanks in advance for every replie
  • Multiply second value from array to dropdown selected

    I have created a row of drop downs with each option having its own value, as usual. But what I need to do is multiply a second value per drop down to the options values. I understand the process of whats needs to be done, but I don't know where or how to add this extra figure in. Her is it in action in this fiddle - http://jsfiddle.net/c9r48/8/ In the first dropdown for instance it has a label of 'label 1' the options values of: label: 'Label 1', value: '400', options: { '12': 'Monthly', '6': 'Bi-Monthly',
  • Anglo jquery?

    Hi, Has anyone heard about Anglo jQuery? I was stumped when somebody asked me. Any website for more inputs? Also, how many of these kinds are there? (if et all) Thanks in adv...
  • 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