• jQuery replaceWith and restore the scrollposition

    Hi. I have a DIV position absolute and on overflow scroll. Whenever status changes  whole DIV is replaced with a new.  The problem now is before the scroll animate event triggers . The DIV is set scroll position to 0 and starts from the top and not from where it was before. How to call replaceWith(newDiv,true) to keep the scroll position. This issue is discussed here http://stackoverflow.com/questions/2009029/restoring-page-scroll-position-with-jquery Thanks B L Praveen
  • Invoke a function parameter from table cell click

    Hi there, I try to build a function that create a table dynamically using jQuery, the function accept an array of objects as parameter, each object in the array is the data for creating a single row.  One of the object items in the array is a javascript function that I'd like to invoke when user click a table cell code is here Problem is the click event does not work.
  • I click on first div two times then click on the second div one time but get alert two times that "You have clicked on the second div"

    <html> <head> <script src="http://code.jquery.com/jquery-1.10.2.js"></script> <script> function myfun() { alert("You have clicked on first div"); $(".def").click(function () { alert("You have clicked on the second div"); }); } </script> <style> div { border: 1px solid blue; width :200px; height: 200px; margin : 30px; } </style> </head> <body> <div class="abc" onclick="myfun();">First Div</div> <div class="def">Second Div</div> </body> </html>
  • Uncaught SyntaxError: Unexpected token var (using switchButton)

     am trying to read a data attribute from switchButton event, but I got this error :  Uncaught SyntaxError: Unexpected token var Here is the fiddle : http://jsfiddle.net/mlotfi/pot095x3/ Thanks.
  • jqXHR object in load(event, ui) event within the Tab widget

    Would it be possible to have the jqXHR object after an Ajax request has arrived? Of course I can attach a handler to the ajaxComplete event but what if there is some logic that is required within the tab's behavior? In the snippet I have below, I need to read some information that comes along with the response headers and act on it before the tab is fully loaded. $("#tabs").tabs({     load: function (event, ui) {         // FYI ui.jqXHR does not exist here         if (ui.jqXHR.getResponseHeader("X-LOGON") == "LogOn")         {             // Prompt user to log in first before the content is shown         }         else         {             event.preventDefault();         }     } });
  • jQuery problem with resizing divs

    The code may seem lengthy, but it really is just a bunch of repetitions. But the length is irrelevant, just pay attention to the resize event, which is defined first thing inside the ready() function of jQuery. My test page displays 4 divs. My objective is to cover up these 4 divs with 4 other divs I created during runtime with jQuery and be able to survive any kind of browser resizing. When the code is run, click the buttons labeled "Cover Div 1", "Cover Div 2", "Cover Div 3", and "Cover Div 4".
  • How to manipulate XML and post back to original XML file

    Note: All of the code in this question pertains to local data. This is not going to be on a web server, but locally on the PC running the code. I have an XML file (current_jobs.xml) and an XSLT & CSS file to style it. I am currently showing the XML file via an HTML file using Javascript. <html> <head> <title>Job Board</title> <meta charset="utf-8"/> <link rel="stylesheet" href="style.css"/> <script type="text/javascript" src="jScript.js"></script> <script type="text/javascript" src="jquery-1.11.2.js"></script>
  • How to make butons in footer to take all footer width

    Hi,   I have footers with variable number of buttons, if there's only one button it should take all available footer space, if there are two - each will take half the footer width, and so on.. I'd like to have some space between buttons. What would be the best way to achive this?   Thanks!
  • need help with linking images

    hi folks i need to know how i can add links to the images...many thanks  <!doctype html> <html> <head> <meta charset="utf-8">   <!--Latest jQuery Core Library--> <script src="http://code.jquery.com/jquery-latest.min.js"> </script>   <!--Cycle2 Plugin Script--> <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery.cycle2/20130409/jquery.cycle2.min.js"></script>   <!--Cycle2 Carousel--> <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery.cycle2/20130409/jquery.cycle2.carousel.min.js"></script>
  • Can I autoFocus fire on roll off

    I want to have the first element in an autocomplete list autoFocused when the list is open and a user rolls off.  Currently if you use autoFocus and use your mouse to roll over the list and then roll off, no item is selected. I'd like to have the first item in a list become autoFocused again if a user uses their mouse to roll off. Is this possible? Thanks for any help. Also you can see the jQuery functionality here. http://jqueryui.com/autocomplete/
  • How to get the data from the querystring of jquery.form.js form submission

    I am using jqury.form.js to submit a file along with some parameter.I also get the data in the alert in before send function,in this format filename=1&filename1=b&postedFile=.... this format.Now i want to get those data in the servlet individually.So now i m posting my code .. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script> 
  • Problem with patch for ajax timeout reporting

    Currently it appears not to be possible to know, in the ajax error callback, if the request has failed due to a timeout, versus some other reason. Knowing this is important for implementation of a good UI, which wants to be able to say more than "timeout or other error". I propose having the "status" parameter contain string "timeout" when the error is due to a timeout.  try
  • Apache, PHP install problems

    Hello, Im trying to install apache and php on my windows desktop. So far I have met with abject failure. I have gone through dozens of demo's and provider installs, since apache doesnt provide binaries any longer. Does anyone know of any link that can help me install apache and php? God knows Ive tried just about all of them. ThankYou  
  • Dynamic form inputs with jquery

    Hi, i need to do simple dynamic forms input for files uploading $('.add_field_button').click(function(e){       $('.input_fields_wrap').append('<input type="file" class="form" name="fileField" />');       }); i just tested simple this script is working everyting fine with a default html files input, but my html template using two inputs for file uploading one input for show what you selected and one to show attach button <div class="input_fields_wrap">        <input type="text" class="form" name="textfield"
  • Show/hide element (of option list) from other form element

    I have two form's elements: checkboxes and drop-down list. Checkbox value is link with drop-down list by id (option id=checkbox val) The option list should be hide by default. After checkbox is checked I want to show specific options from the list. Unfortunately it doesn;t work properly. My code: <input type="checkbox" name="newsletter" value="Hourly">Hourly <input type="checkbox" name="newsletter" value="Daily">Daily <input type="checkbox" name="newsletter" value="Weekly">Weekly <input type="checkbox"
  • multiple Buttons opens up a function, same action but different ID container.

    Hi I need some help, I have multiple Buttons (12 at the moment), all have the same id with following letter. "BtnA", "BtnB", "BtnC" and so on. each btn opens up a function, same action but different ID container. for example : "BtnA" open "containerA" and do function (BLA) "BtnB" open "containerB" and do function (BLA) "BtnC" open "containerC" and do function (BLA) and so on. I have a code that working but it contains more than 500 lines...  I am looking a way to short it up. here is the code on
  • Retrieve value from object

    Hi,   I am using SharePoint Client object model to fetch data from a custom list.   I have a URL field which contains the url value.   I am trying to access the data, but I am getting as [Object].   code used is:   function RenderHtmlOnSuccess()  { var enumerator = this.TestListItems.getEnumerator(); while (enumerator.moveNext()) { var currentItem = enumerator.get_current(); var imagePath = currentItem.get_item("testfilePreviewPath");  } }   In F12 of IE, for currentItem.get_item("testfilePreviewPath"),
  • javascript how to sort strings containing comma separated values

    I would like to know how can I sort strings in javascript containing comma separated values in different order e.g.       1. Need to remove the distance "Km"       2. Sort values comma delimited ASC       3. append the distances to each distance input value "10km,50km, 21.1km"; result "50km,21.1km,10km";Your help will be appreciated. Thanks
  • jQuery Validation - manually set field invalid

    I have a form using jquery Validation that was done by another developer. Rather than using the built in remote option, he put in his own onblur on one specific field in the form that shows a box with a special error. Is there a way to somehow add a class or something to the input which tells the validate() to fail? I've googled a bit and not seen it. Suggestions?
  • jquery .on("click") event fires only on the 2nd click

    Hello,            I am new to jquery. And I am trying to fire a click event when a link is clicked. But, the click event fires only on the 2nd click. Have any of you encountered this issue or direct me to resolve this issue? Here is the code I am using. $( "#request_table" ).on( "click" , "#vm_details_link" , function (e) { e.preventDefault(); alert("Click fired"); } Thanks, Naga
  • Get all values of a Dropdownlist which is not multiple enabled

    Hi all,  I was wondering if it is possible to retrieve all values of a dropdownlist which is not MULTIPLE enabled. This is the code i have that may work on a multiple enabled dropdownlist. But in my case, i dont want to allow the user to select more than one value from the dropdownlist.  var values = []; $('#my_dropdown option').each(function() { values.push( $(this).attr('value') ); }); And on submit, i want to post the entire array of content on the dropdownlist. Is it possible? Someone please
  • Setting Values from array

    Hi,   I have a dropdown and 2 labels in my aspx page. I am trying to fill the dropdown and the label using jquery.   I have used the below code:   //Declared Globally var testarray = []; var fileDescription = ""; var imagePath = ""; var Title =""; $(document).ready(function () { while loop  //values added to each item { testarray.push(Title) + "$~@" + imagePath + "$~@" + fileDescription); } SortArray(); }); function SortArray() { var ddlImg = this.document.getElementById("ddlImages");        ddlImg.options.length
  • pass parms to JS

    Hi i read a couple of tutorials an try do understand jquery. one question is in my head: normally i have buttons like HTML <button type='button' name='testbtn' onClick='dosome('1','cars')' value='T1'>T1</button>      Now in JQuery i would do something like this HTML <button type='button' id='idtestbtn' value='T1'>T1</button>      external JS-File $(document).ready(function() {     $('#idtestbtn').click(function(){         ...     }) }); How can i pass the parms"1" and "cars" to the jQuery Code for
  • JQuery Mobile - Set the content at the center of the page.

    Hello everyone, I've a page with DIV based design.  The content of this page needs to be kept at centre (vertically and horizontally) for all different type of view ports. We applied various ways to do so, like changes in css, script calculation, JQuerymobile centre function, reloading the pages etc.  Most of the above implementations are working as expected in browser emulators but not on actual devices.  When we browse the same either in tablet or mobile devices and change the orientation of the
  • Read (invalid) value of input

    Hello all, Using JQM 1.4.2 I have a problem with inputs that require (standard/default) validation. For example if I have an <input id="v1" type="number"> and I enter the value "12a" my input becomes invalid, which is ok. But, if I then get  document.getElementById("v1").value() I do not retrieve the invalid value "12a" but get an empty value instead, leading to the wrong error indication feedback to the user. Is there any way to get the actual value of the input control? The same problem appears
  • weird response

    Hello Folks, I am jQuery newbie. I encountered a really weird response must be my mistake somewhere. I have been researching on internet for 2 days but not found my thing so finally decided to seek help from experts. What I wrote is here. <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script> $(document).ready(function() { $("input[name='radioship']").change(function(){ $("form").submit(); }); }); </script> <form action="" method="post" name="frmCart" action="go.php">
  • Fetching value from label in jquery

    Hi,   I am using aspx, js file.   I have a hidden div in which I have a label. The value of the label is added dynamically using aspx.cs code, and which is getting added. However I am not able to fetch the value in js file. I have used the below code:   // aspx <script type="text/javascript" src="/Scripts/testSearch.js"> </script> <script type="text\javascript">  var lblCatId = "<%=lblCategory.ClientID%>";  </script> <div id="HiddenDiv" style="display: none;"> <asp:Label ID="lblCategory" runat="server"
  • selectmenu: refresh selectmenu button width

    how can i change the selectmenu width (after ajax refresh) dependent on selectbutton text so the text is seen without ellipses .selectmen('refresh') does'nt do that "Hello..."    => "Hello selcetmenu" 
  • image in tab header of jQuery UI Tabs

    I want to place image in tab header alongside tab name. I tried to use span element inside anchor tag. It is showing image but with "Loading.." text. .tick {       background: url("../../images/redTick.png") no-repeat scroll 0 0 transparent; } <li>       <a href="#1">Frame<span class="tick"></span></a> </li>
  • jQuery, jCanvas, jQuery-ui, slider position on page

    Hello, I am a noob when it comes to these languages/frameworks/widgets, but I am getting better. I have created two rectangles on the canvas and all is good. Now, I need to put a horizontal slider, the user selects a value, between the two rectangles. I get the slider on the page but it is below the canvas. I 'assume' this can be done and I am missing a part. Maybe a CSS needs to be created. What am I missing/doing wrong? Thanks for your time, Mark
  • Toggle image source with fade effect

    Here is my code: http://codepen.io/vkhu/pen/Eammve I'm trying to create a cover swap effect for a book. Basically, I want the image source to change from img1.jpg to img2.jpg when I press the "back cover" line. If I press the "back cover" line again, the source changes back to img1.jpg. Also, when the covers are swapping, there will be a fade effect. I can only do the img1->img2, but not the other way. And I have no clue how to make a fade effect. Can anyone help my please?
  • Selecting a HTML Element with Specific Content String

    Hi jQuery Genuises,  I've been using jQuery for a while, but generally have  only kept things pretty basic.  I'm trying to parse through some <span> elements on a page, find one which has the content 'Workshop' (a string) and add some custom CSS to it.  addClass() is a pretty usual thing for me to use, but I can't figure out how to have jQuery select the proper span.  $('span') + ??   Any tips to send me to the right function?
  • how do I use downloaded Themroller on my site? More specificly Tabs

    I'm very new to learning jQuery (and coding in general) don't really understand the lingo so please be patient with me if I don't seem to not understand something you're saying or what I'm not able to convey what I'm trying to say. Thank you for any help you may be able to offer. I recently downloaded a custom theme from the jQuery Themeroller and want to add tabs to my site try as I might; I just cant get them to work properly. My code seems to be right because I compared it to the example code
  • Jquery Toggle

    Hi All, I am using the following code to toggle. But somehow it does not work. The reason I found is it does not support special characters like : ~ in the Id reference. Is there any workaround to fix this issue.  Note: I cannot change the Id name as it is system generated. <!DOCTYPE html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script> $(document).ready(function(){   $("button").click(function(){     $("#d:dashboard~p:k1s87ca25ol4e0b7~s:kfld0kqbros586fm").toggle();
  • Download a file via AJAX

    Hi,  I am starting with ajax and got a problem with a download I would like to make via AJAX.  $( document ).ready(function() { console.log("jQuery Version : " + $.fn.jquery) $('.documentIcon').click(function(){ var src = $(this).attr('src');     $.ajax( 'http://localhost/file-stream/response.php', {     'xhrFields' : {     'responseType' : 'blob'     },        'dataType' : 'binary' }) .complete(function ( xhr ) { console.log(xhr);    var $a = $( '<a />' ), url = URL.createObjectURL( xhr.response
  • How to Get Scroll Position Every 200 Scroll?

    I am trying to get the scroll down and up position at This Demo  but as you can see it is updating the <p> element on every pixel by pixel scroll (Up or Down). But what I need to only update the <p> on every 200 scroll until reaching the end of the div (right now the p element is updating on every single scroll ). Here is the code I have: $(window).scroll(function () {           var height = $(window).scrollTop();           if (height > 200) {               $('p').html(height);           } }); <p></p>
  • New To jQuery. Can't Figure Out Why This Doesn't Work

    Any help on this appreciated.  I am completely new to jQuery.  I am definitely missing someting... Thanks in advance for your time... <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI Datepicker - Default functionality</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css"> <link rel="stylesheet" href="/resources/demos/style.css"> <script src="/Scripts/jquery-ui-1.11.2.js"></script> <script
  • Jquery ui datepicker does not hide when click outside on IOS(iphone and ipad)

    I am using juqery-ui-datepicker in my website, on IOS, when I do not select any date and just click outside the element, it does not hide the datepicker. hover it working fine on Andriod. Is there anyone who is able to find the problem? 
  • tabs UI - Loading additional php content in open tab will destroy css

    Hi I want to run a booking program inside of tab 3. When I try to open an add all the content goes underneath the tabs area. is there any script snippet to hold all the content inside of the open tab on loading additional content via php, like in my case? Here is my example: http://www.zakynthos.net.gr/Vacations/jquerytab.php I tried out following without success: $(document).ready(function () {     var currentTabIndex = "3";     $tab = $("#tabs").tabs({          activate : function (e, ui) {            
  • Can not submit modal form when have two modal on page

    I have a view with two pop-up dialog form, example bellow, form 1 can not submit (click submit button of form 1 (name Print PDF), nothing happen) when form 2 exist, please help  //Form 2 <div id="dialog-form-2" title="Form 2" style="display: none">     <form class="singlepopup">         //some stuff     </form> </div> //Form 1 <div id="dialog-form-1" title="Form 1" style="display: none">     <form class="singlepopup" id='pdf_frm'>         //some stuff     </form> </div> //Script for form 1, with
  • 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