jquery

Faster alternative to jQuery's .html function?

I was wondering if there is an alternative to the jquery .html(variable) function? It seems to be quite slow and also freezes while inserting the html into the DOM. I tried using innerHtml, and that works great, extremely fast as well. But for some reason, when I have any jquery or MS ajax in the code that is inserted, those scripts ONL...

jQuery Email Address Input

I'd like an autocomplete/autoformat "To" field on my web site that works like the one in GMail: Does anyone know of such a thing for jQuery? Plain JavaScript? Or any other alternatives? ...

How to have member variables and public methods in a jQuery plugin?

I'm trying to create a jQuery plugin that will create something like an autoCompleteBox but with custom features. How do I store member variables for each matching jQuery element? For example I'll need to store a timerID for each. I'd also like to store references to some of the DOM elements that make up the control. I'd like to be ab...

Randomize a sequence of div elements with jQuery

Hello all, I'm trying to do my frist steps with jQuery but I have some trouble to understand how to find a list of child elements from a div parent element. I'm used to work with ActionScript 2 and ActionScript 3 so i could mistake some concept, like what is the better way to randomize a sequence of div elements with jQuery! I have this...

How to wrap the click event with some custom function

I have a button called 'create project', when user click the button, i want 2 things to happen an ajax call to check if the user is allow to create a project if allowed, then execute the button as normal, if not, then pop up a modal dialog saying he is not allowed to create a new project. I have the following code $('.create_proje...

jquery special characters saving in mysql, php

I am trying to save Mobile Number in MYSQL table with following Format "+1234987...." but when i save data + sign is replaced with space, i am using following code var mobile = $('#mobile').attr('value'); $.ajax({ type: "POST", url: "save_process.php", data: "mobile="+ escape(mobile) , //data: "mobile="+ mobile , success: function(...

Register jquery plugin in updatepanel

I have updatepanel with timer control that executes once (gets some images after initial page load) How to register jquery plugin (interfade) on updatepanel postback (or better jquery js along with plugin)? I prefer loading plugin after timed postback to reduce initial page size. ...

jquery: nested tags and hover() not working in IE

hello folks! i have a construction like this: <div id="container"> <span> <span></span> </span> <span> <span></span> </span> </div> i need to catch the mouseout event of the container, so i made jquery do this: $("#container").hover('',function(){ alert("Out"); }); In Firefox / Opera, it only fires the mouseout-function...

radio button select on label click

i have following code for radio buttons how can make radio buttons to be selected when i click on any of two labels in front of that radio button. <div class="label_main" style="width:350px"> <div class="label_radio"> <input type="radio" name="group1" id="group1" value="0" <?php if($r0==0) { ?> checked="checked" ...

How can I use Jquery Datepicker to highlight with befereshowday two different kind of special dates?

I mean, I found here a way to disable an array of nationalDays. I'm trying to make a code to disable the national days and also to highlight some other days (I'm coding a web app and I will pass another array of days) but to let them enabled. Imagine a calendar where you can see three different day colors. The first one, today's date. ...

jquery google analytics datepicker

Anyone know of any open source datepickers that work like the Google Analytics date range pickers? You can see an image here http://img17.yfrog.com/i/googledaterangepicker.jpg/ ...

jQuery and Ajax, loading only one item from the database

Please look at this code: $('ul#navigation li ul li>a').click(function(){ var active = $(this).text(); $('#artcontent p').empty(); $.ajax({ type: 'POST', url: 'homepage/readarticle', data: $(active).serialize(), success: function(databack){ $('#loading').fadeOut('normal'); ...

Origin of the name jQuery

This may seem like an odd question, but does anyone know the origin of the jQuery name? How did it come to be called "jQuery"? ...

jQuery draggable clone with y axis restriction

If I have this markup: <table id="sometable"> <tr> <td class="x"><span>111</span></td> <td>aaa</td> </tr> <tr> <td class="x"><span>222</span></td> <td>bbb</td> </tr> </table> And this jQuery code: $(".x span").draggable({ helper: 'clone', axis: 'y'}); When dragging the first column the cloned span is...

Simple Toggle with Mootools: What am I doing wrong?

<script type="text/javascript"> $(document).ready(function(){ $("#trigger").click(function () { $("#trigger-banner").toggle(); }); </script> Help? Thanks! ...

How to select appended element in UL list

I want to add an LI to my UL list below above the .last-child: <ul id="list"> <li>item 1<li> <li>item 2<li> <li>item 3<li> <li class="last-child"><li> </ul> I am using the following JQuery code to do so: var result = '<li>item 4</li>'; $("#list li.last-child").before(result); That all works fine. However, I want to ...

How to find out if an element contains only a £ sign with JQuery?

Hi Guys, Say I have 2 divs: <div>&pound; 21.99</div> <div>&pound;</div> If I only want to select the div that contains the symbol only, how would I go about this? I have tried: if ($('div:contains("&pound;")').length > 0) { $(this).addClass("pound"); } ...

jQuery function in .attr is called only once for all matching tags.

I'm teaching myself jQuery by writing the game of memory (where you turn tiles over two at a time, looking for matches). I have 16 img tags, each representing one of the tile faces. I have an array of 16 jpg file names. I want to set the src attribute of each img tag to a random selection from my array. To do so, I wrote a function t...

Apply random color to class elements individually?

My goal is to each div with a class of "main" to have a random background color. I have the script that generates the random color but, using jquery, I only seem to be able to apply it to all divs in the class. How can I select a div, apply the color, select the next div in the class, generate a new random color, apply it and repeat? Her...

jquery: validate form with multiple checkboxes -- at least one must be checked

I'm trying to validate a form using the validate plugin for jquery. I want to require that the user check at least one checkbox in a group in order for the form to be submitted. Here's my jquery code: $().ready(function() { $("#subscribeForm").validate({ rules: { list: {required: "#list0:checked"} }, messages: { list: "Plea...