• I'm desperate with function ( $. each ())

    Hello friends. I need help to replace forEach function with $.each Original Code:     //iterate list trunks/branches     function listBranches(trunk) {         var $trunk = $("<ul>", { "data-level": ++level });                   trunk.forEach(function (branch) {             var $wrapper = $("<div>", { "data-level": level });             var $branch = $("<li>", $.extend(branch.props, { "data-level": level }));             if (branch.sub) listBranches(branch.sub).appendTo($branch);             $branch.appendTo($wrapper);
  • Image Survey Plugin

    Hello ALL! I'm new here.  I have a problem that I have been searching all over for.  I'm trying to find or build a jquery image survey plugin like this: https://beautyarmy.com/account/surveys/1 Depending on the boxes hit, the user would be taken to the next set of questions/boxes. Each question will ultimately come together to build a product.  For instance, question 1 + box 2 = product and so on for the rest of the questions.  All together it adds up to the ultimate product. Once they answer about
  • How to find width of all images and apply them to their parent containers

    Here is what I do but it does not seem to work. I use window.varName because I need to reuse them in another functions. $("#rollovers li img").each(function(){                         window.imgWidth = $(this).width();                                               $("#rollovers li").css("width" , imgWidth ); });
  • Help!!

    please i nedd help!! i want to create a mobile application  (support: Android 2.3) and i don't know haw to start... what technologies do i need??? jqm+phoneGap+??? do i need SDK and java and Json....please help!! it is not complicated the idea of the application just transitions and pages and buttons and access to data base to get the informations of a client for exemple..thank you.
  • Help!!

    please i nedd help!! i want to create a mobile application  (support: Android 2.3) and i don't know haw to start... what technologies do i need??? jqm+phoneGap+??? do i need SDK and java and Json....please help!! it is not complicated the idea of the application just transitions and pages and buttons and access to data base to get the informations of a client for exemple..thank you.
  • How to change all "name" attributes in a cloned div?

    The script below is working fine but... I need all unique "name" to send the form with php. Can someone point me in the right direction? $(function() {                $('#pers').change(function() {         var personsSelected = $('#pers option:selected').data('costid');         var personsDisplayed = $('[id^="customer-"]:visible').length;         var personsRendered = $('[id^="customer-"]').length;         if (personsSelected > personsDisplayed) {             for (var i = 1; i <= personsSelected;
  • Is there a reference list to CSS selectors that are tied to the UI objects?

    Hi I'm fairly new to JQuery coming from a decent JavaScript background I'm stumbling my way through and figured out a bit through sample codes etc and the API documentation.   Looking into the accordion demo I realized you can apply styles to objects with something like this .ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin-top: 2px; padding: .5em .5em .5em .7em; zoom: 1; } .ui-accordion .ui-accordion-icons { padding-left: 2.2em; } .ui-accordion .ui-accordion-noicons
  • en: View 'div' by clicking on a 'LI'. //pt: Exibir 'div" ao clicar em uma 'LI".

    --- Translated by Google to english -- I have several elements "LI". Within each element, have a "div" with a class, I want that when you click on the element "LI" display only "div" of "LI" that was clicked. --- Original in portuguese -- Tenho vários elementos "LI". Dentro de cada elemento, tenho uma "div" com um class, quero que, quando clicar no elemento "LI" exiba somente a "div" da "LI" que foi clicada. 
  • How to capture href event in a table row with multiple href's

    I have a table structure which contains several href elements.  One of the href elements calls a delete function and I'd like to pop up a dialog to ask the user if they're sure they want to do the delete. How do you capture the href click event and how do I identify which href was clicked when you have multiple href's in the table line. Thanks, Tom  <tr>     <td style="text-align:center; width:5%;"><a href=xxx.php?StaffEditID=<? echo $StaffID; ?> ><img src=pencil.gif border=0</a></td>     <td style="text-align:center;
  • Why $("body").data("n","123"); fails inside ajax success function ?

    Folks, I am using .data() to store some data. It fails during my intended action. My syntax is, I believe correct because the same command/syntax works fine when it is placed elsewhere in the code. Thus, in the example below I would expect the alert to give me "123" but instead, it gives me "undefined".  If I place the store request else where (inside the GetDefaults() function but external to the $.ajax request, it works. If I place it before GetDefaults() it also works. But when executed as part
  • VALIDATION ERROR MESSAGE WITH CHECKBOXES

    I have:    <li id="li_9">      <label class="description" for="element_9">Gender *</label>      <span>       <input id="element_9_1" name="element_9" class="required" type="radio" value="1" />       <label class="choice" for="element_9_1">M</label>       <input id="element_9_2" name="element_9" class="required" type="radio" value="2" />       <label class="choice" for="element_9_2">F</label>      </span>     </li>     Yet if none are chosen, the error message cuts right through the middle of the
  • send a value in jquery mobile from page to page

    how I can to send a value from page to another page This message is displayed after I installed my application on a tablet  Application Error : une erreur réseau s'st produite(file:///android_asset/www/maPage.html?MaValeur)
  • Fileselect control

    I have created a textbox control. Now I want to create a fileselect control and use the textbox control to display the file selected. How do I do that?   Basically , I should be able to enter the input in the textbox or select the file. I want to use the same area used by the id orignum to display the file selected?    <label for="Orig Number">Orig Number</label>  <input id="orignum" name="orignum" /> <input type="file" name="filesToUpload" id="filesToUpload">   Both the controls appear inside the
  • Newbie - Help with a navigation menu

    Hi I'm relatively new to the whole mobile development area so apologies for this. I'm having a small problem with a sample application I'm just trying to get up and running. In the code below you will see I'm trying to make a navigation menu for the homepage of my application however when its run in the emulator/on any browser window the menu buttons rendered will end up on the side of the page. What I am ultimately trying to do is to get the 4 buttons centered and made bigger so that each button
  • Can a jsonp ajax call be done with xml?

    Hello, Im trying to do a mapquest cross-domain ajax call.  But, the format of json they want is not valid. They are expecting the json to be formatted as such: json={locations:[{street:"York,PA"},{street:"Red Lion"},{street:"19036"},{street:"300 Granite Run Dr, Lancaster, PA"}],options:{thumbMaps:false,maxResults:1}} http://open.mapquestapi.com/geocoding/#batchsample But this format is not valid in jquery. It even fails in the json validator website. Thusly, Im getting errors all over the place.
  • jquery leave domain?

    Hello,   i need to open a popup, when the user leaves a website. i mena the complet site/domain and not  a single page.  i try this <script type="text/javascript">     jQuery(document).ready(function() {         $(window).unload( function () {             alert('unload');             });         $('a').unbind('unload');         }); </script> but the popup appears  always, when i leave the page and when i click a link inside the page What is wrong in this code?
  • popup

    How to open popup image at body onload page
  • Different files of jQuery with different versions are creating issues

    Hi All, We are using three different jQuery files of different version in our project. (1) jQuery-ui-custom-min-1.9.2.js -  For Ajax modal popup (2) jQuery.min.js - For all other jQuery related fucntions (3) We have one Quick poll functionality placed on our site. we use jQuery version  1.4.3 with some custom code here. we are referring all 3 files on one page. Now in AJAX modal popup there is a method named "dialog". We are getting an error here. Mentioning that "object doesn't support this property
  • JQuery

    Hi  I'm trying using Jquery and Jsp page to create GUI , it's simple . here is my code, in my folder, I create a Javascript library file ,  which contain jquery-1.8.3.js. So, when I click <button>Get External Content</button> it will display content in demo_test.txt ,but it didn't . Can you help me?? <!DOCTYPE html> <html> <head>     <script language="javascript" src="Javascript/jquery-1.8.3.js"> </script> <script> $(document).ready(function(){   $("button").click(function(){   $("#div1").load("demo_test.txt");
  • Ajax Search Not Updating Content

    Hello All! code below is for a carousel of a few images. Images are inline on page body. It has next / previous navigation. It also has a search box to enable search of an image by its name. Its an ajax request to a php file that uses an array to hold the images. Navigation by next / prev works. Using ajax search displays the specific image searched for on a first search. The searched image gets loaded into the carousel and hides the viewable images in the carousel viewable area. This is desired.
  • change title words when the user change the browser language

    hi guys, i am working in globalization for diferentes languages. i wanna know how can i change the tag (alt) and (title) for another word. like the when the broswer be in english load the normal, when the browser be in portuguese put the portuguese word. so if english load what i have in english. <img src="../images/reviews/smiley_sad.png" alt="very bad" title="Rate this clinic as very bad"/> if pt-br in broswer so will change for <img src="../images/reviews/smiley_sad.png" alt="muito mal" title="Avalie
  • jquery

    In Accordion jQuery functionality, how do you shift the tab positions dynamically using left, right, top and bottom without using UI plugin? Example: There is a drop down with four values these are 1.top 2.bottom 3.left and 4.right If i click on top - Tabs should display top to bottom direction If i click on bottom - Tabs should display bottom to top direction If i click on left - Tabs should display left to right direction If i click on left - Tabs should display right to left direction Assume there
  • Understand Module Pattern described in Code Organization Tutorial

    Considering the last code fragment (reported below) about module pattern published in the Code Organization section of the Learning Center, I'm trying to understand some aspect of the module in the example: the variable declarations ($items, $container...) are separated by ";" while the function declarations (createContainer, buildUrl, showItem, ....) are separated by ","...why? Is there a bracket problem? why the name of the first three variables ($items, $container and $currentItem) starts with
  • header location iPhone start from Home Screen

    I have a web app that I converted from jQTouch to jQuery Mobile and it works beautifully in browser mode on iPhone, but when I use the Add to Home Screen feature I have a problem. When it runs in this mode the header bars are partly hidden by the phone's status bar at the top. My workaround is to set a margin-top for the ui-header class, but then it looks a little silly in browser mode. Is there a way to get proper behavior in both modes? <head> <meta name="viewport" content="width=device-width,
  • jQuery Forms Plugin: append response text?

    I've been banging my head over this. Is it possible to append the responseText as an li element rather than replace it? I have something like this that doesn't work:  $(document.ready(function () {       var options = {             target: "#ul_element",             beforeSubmit: validate,             success: function () { $("#ul_element").append(responseText); } Thanks!
  • SetFocus to a field & show iphone keyboard

    My requirement is to set focus into first input field when a page is shown or a previous input is blur-ed on iOS4.  Few ppl raised the same question on other online forums, but any of solutions worked. (most of the solutions work fine on Android, however not on an iphone). Any ideas or workarounds? thanks
  • Correct syntax for Definition List (<dl>) in jQuery UI's Nested Menu?

    I’m trying to combine jQuery UI’s nested menu with definition list (<dl>) elements, but I'm having trouble figuring out the correct syntax because a nested menu starts with <ul> and a definition list starts with <dl>. My reason for doing this is to create nested dropdown boxes, and I'm using the script and css in this fiddle to have the DL elements look and act like dropdown boxes. This code is the closest I've gotten, but it's not quite right because when the <dl> element is clicked, instead of
  • Display (span) div id's when scrolling

    im trying to display a div id when scrolling, when a div is 100px under the top id like it's id to be displayed. All divs have id's such as '1' '3' '5'. All divs do have the class 'post'. Second Question all divs have odd numbers which id like to display in 'pagnering-odd' can I make it so if 1 is displayed in 'pagnering-odd' then 2 is displayed in pagnering-even. best $(window).scroll(function() {     $('.post').each(function() {         if( $("#container").offset().top > $(this).offset().top )
  • return array

    This is not at all about jQuery, but it came across in one of my jQuery solutions O:-) When I want to return an array there can't be new line immediately after the word 'return' but whitespace is OK. Is this syntax error? Or something else? I don't understand it, because everywhere I can add new lines and nothing happens. I've prepared example here http://jsfiddle.net/3CyVE/
  • How to handle json returned to autocomplete from servlet

    I'm trying to use the autocomplete widget to and to populate it I am using a servlet which is returning a JSON array.  Bear with me, I'm not sure how much you need to see so I'm going to include a lot. Here is how I am constructing the autocomplete right now.  It's not complete yet because I don't really know how to finish:                 $('#usernamesearch').autocomplete({                     minLength: 2,                     source: function(request, response) {                         $.ajax({
  • How do I force a repaint with jquery

    I have a video in an iframe that displays OK in IE, but its all dark in chrome.  I find that if I switch to another tab in chrome, and then switch back, it is now displayed.  So I'm thinking of forcing a repaint of the div that contains the iframe - or the iframe itself.  I experimented with .show, .hide, and .toggle, but  this doesn't seem to work. Anyone  have ideas?
  • event.target.name

    Hi, event.target.name works only for <input> tags?
  • submitting a form in FF or chrome works fine IE dosnt work

    <script type="text/javascript" src="system/jquery-1.8.2.min.js"></script> <script type="text/javascript"> $('#setPAGE').submit(function(){$('input[id=subaddPAGE]', this).attr('disabled', 'disabled');}); function grabPAGE ( ) {       var page_title = $("#page_title");         var page_desc = $("#page_desc");         var page_content = $("#page_content");         var url = "system/JQ_addpage.php";       if (page_title.val() == "") {            $("#IAC").html('<div id="JQUERY_processor_container_RED"
  • Paging using table sorter code

    <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Test2.Models.Movie>>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> Index </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <link href="../../Content/style.css" rel="stylesheet" type="text/css" /> <link href="../../Content/jquery.tablesorter.pager.css" rel="stylesheet" type="text/css" /> <script src="../../Scripts/jquery-latest.js"
  • Can't build jQuery on OS X 10.8.2

    Starting some time ago I can't build jQuery on OS X 10.8.2. It happened when master was on 1.9.0pre and it happens now when it's 2.0.0pre. If I follow instructions and run: $ npm install $ gruntI get an error: <FATAL> Unable to find "grunt.js" config file. Do you need any --help? </FATAL>Next, I tried to provide a config file (though it probably means README.md should be corrected): $ grunt --config Gruntfile.jsbut then I get this: Running "update_submodules" task Running "selector:src/selector.js"
  • browser re-size issue slider out of conatiner

    0 down vote favorite when i re-size the browser window the slider goes out of the main container i am using bootstrap responsive css i see the extra margin in the slider container if i remove its ok but if i still make the window smaller slider goes out how to fix the bug... http://jsfiddle.net/48y2Q/embedded/result/ http://jsfiddle.net/48y2Q/ providing my code below <div class="container"> <div id="da-slider" class="da-slider" style="margin-top: 0px; margin-bottom: 0px; height: 300px; background-position:
  • Open a div with a same position as a list item

    How can I achive this. What I need to do is basically open a Div in position 1 when list item form position 1 was clicked. Then open a div on position 2 when list item in position 2 was clicked etd. <div id="rollovers">       <ul>                 <li>List item 1</li>                 <li>List item 2</li>                 <li>List item 3</li>       </ul>       <div id="targetCont">             <div>Content for list item 1</div>             <div>Content for list item 2</div>             <div>Content
  • Using a function in the expected field of equal()

    I have a function that starts a timer. Im using the asyncTest function to test my lapTime function, to make sure its within an acceptable range. I set the asyncTest to 4000 milliseconds, and then set my equal() to expect a value of 4. When running the test, it came back with a value of 3.999 and 3,998. I decided to then just change my expected to be >=4, which would tell me if my function was grabbing the time correctly. when i changed my expected to be (lapTime() <= 4, ) it says my expected output
  • jquery mobile popup and image maps

    Hi, I have a page which has an image as the backgroud. I have 30 different points on the image and need to open a new image on click of these point in form of a popup on the same page (exactly like an jquery mobile popup). Since the JQMobile popup is liked to a <a> tag and the image map is using <area> tag i am unable to do it. Here is what i did.. <img src="images/img/landing.png" alt="landing" usemap="#Map">     <map name="Map">       <area shape="rect" coords="1369,176,1470,222" href="#dialog"
  • Styling A Fieldset - 7 Buttons in a row.

    Hi, I have a fieldset on my page that contains 7 radio buttons horizontally.  I am stuck however on how to style it as I want the buttons to be red and when pressed change to blue. Also I want a white border around the fieldset and not each button. Example. --------------------------------- | 1 | 2 | 3 | 4 | 5 | 6 | 7 |            : Horizontal role of buttons in the field set. --------------------------------- Thanks in advance, Paul.
  • 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