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?
...
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...
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?
...
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...
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...
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?
...
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...
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));
...
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...
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...
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
...
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?
...
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...
...
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...
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')....
Hello,
I'd like to know for a specific radio button group if a radio button is selected or not with jQuery.
Thanks
...
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...
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...
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 ...
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...