jquery

Check that variable is a number

How can I check that a variable is a number, either an integer or a string digit? In PHP I could do: if (is_int($var)) { echo '$var is integer'; } Or: if (is_numeric($var)) { echo '$var is numeric'; } How can I do it in jQuery/JavaScript? ...

jQuery.fn - Why isn't this working?

What is the problem here? (Besides having redundant code). $.getJSON works as expected. However $.postJSON isn't working. I can inspect $.fn via firebug and sure enough postJSON is listed. However if I try to call it, I get a no function defined error. jQuery.fn.getJSON = function(path, opts){ this.extend(opts, { url: path, d...

Jquery Alternating Rows with visability

Can Jquery zebra stripe a table where some rows are being set to 'display:none' and still have the visable rows alternate in color, without two rows having the same color next to each other? ...

Filtering jQuery Results by CSS Tag

I am trying to dynamically filter search results. Every result has tags associated with it that are used as classes. <div class="search_results"> <div class="html php jquery"> I can do HTML, PHP and JQuery. </div> <div class="jquery asp pascal"> I can do jQuery, ASP, and Pascal. </div> <div class="php bas...

backspace active li class jquery

Hey :) I have a little problem with some jquery and http://www.mikage.to/jquery/jquery%5Fhistory%5Fnoc.html The function works great, my problem is to highlight an li class, tab menu, when user backspace with the keyboard or just use the back button on their browser to return the last seen page. html code li code with the class acti...

When typing $( in visual studio for jquery... it gets automatically converted to $addHandler(

Everytime I start typing $( to call a jquery command visual studio 2008 automatically converts that to: $addHandler( ... I have to delete that and retype it every single time. Is there a way to fix this change it? ...

Can I have a 2 column sortable jquery drag/drop without jqueryUI?

Is it possible to do a basic 2 column wide sortable drag/drop list with jquery, WITHOUT using jqueryUI? I would like to make something more lightweight but still use jquery. All I need is drag/drop capabilities, which sortable function works perfect but I need to be able to have 2 columns act as 1 unit, so a serialized list will show t...

Add css font color with jquery

Hello everyone, Sure it's a simple question, but I can't fix it, can somebody help me? This is the original line $('.winning-col', this).text($('td.win', this).length); and this is where I came up with, surely not correct. $('.winning-col', this).text.css('color', 'pink'($('td.win', this).length)); ...

jQuery Traversing Problem

I am running into a problem that just doesn't seem right. I've got a pair of anchor tags on the same level in the DOM. Structure below: div.mcoup div.lcoup div.rcoup div.rcoupmeta a.rcoupedit a.rcoupdelete div.updcoup div.delcoup And here is the script I'm using: $('div.delcoup').hide(); $('a.r...

How can I show a hidden DIV if a AJAX JSON response shows the proper data?

I am working on a AJAX/jquery notification script. Currently it retunrs a whole fhtml formatted page every 10 seconds in the AJAX response. The page it is returning is a PHP page which only shows items that should be shown (only items that have something NEW show up, like a new mail message or a new comment etc..) I am wanting to cha...

Slightly more complex jQuery Travsersing problem

I have a page that displays search results and has a DOM like the following: div.mcoupdisplay div.mcoup //search result 1 div.lcoup div.rcoup div.rcoupmeta a.rcoupedit a.rcoupdelete div.updcoup div.delcoup div.mcoup //search result 2 div.lcoup div.rcoup div.rcoupmeta ...

Is it possible jQuery to call the siblings of a closest element?

I have the following jQuery: $(this).closest('div.mcoup').find('div.delcoup').slideToggle(400) .siblings().children('div.delcoup').slideUp(400); What I'm trying to do is get the siblings of the div.mcoup element then find all children of the siblings with the class .delcoup then slide them up. Is this possible? ...

How to swap element with jQuery UI draggable and droppable?

I have two div.containers. Both containers have div.item. With jQuery, how can I swap div.item elements by drag & drop? Both element should able to re-swap again. Is there any simple way to do this? Thanks... ...

How do I add items to an array in JQuery

var list = new Array(); $.getJSON("json.js", function(data) { $.each(data, function(i, item) { console.log(item.text); list.push(item.text); }); }); console.log(list.length); list.length always returns 0. I've browsed the json in firebug and it well formed; everything looks fine. I just can't seem to add an it...

slideToggle only sliding down?

This one boggles my mind. I've used this same script (different targets of course) on other elements in my script and it works perfectly. Why, in this instance does the slideToggle only slide down? Here is the hide, slideToggle code: $('div.addLocation').hide(); $("p.buslocadd").click(function() { $(this).prev('div.addLocation')....

Radio button selected ?

Hello, I'd like to know for a specific radio button group if a radio button is selected or not with jQuery. Thanks ...

Jquery - dynamic DIV onclick binding

I have a main page from where I am making a call to "load" and intermediate page's HTML and on the completion of the load I am massaging the returned HTML to add a few DIVs etc, when I try to bind an onclick event for the dynamic Divs (added by me after the HTML returned from the intermediate page) it does not seem to work at all !: LOA...

how to use ajax in JQuery

hi i have that works finw without Script manager. but if i add script manager that getting an erroe: sys udefined. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Block-ui-pageload.aspx.cs" Inherits="Block_ui_pageload" %> <%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyTo...

jQuery AJAX call to ASP.NET WebMethod errors constantly

I have a really simple AJAX method inside my Default.aspx.cs and it looks like this: public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } [WebMethod] public static string GetDate() { return DateTime.Now.ToString(); } } And the Default.aspx ...

IE8 problem with jQuery plugin

Hi I've developed a plugin that makes characters jump and bounce when moused over in any element that contains text. Here is an example. It works great in Firefox 3.5, Chrome, Safari 3.1 and IE7 (oddly, but in compatibility mode) but in IE8 it seems the characters disappear as they rise. I've added top padding to the p element, becaus...