jquery

how callback a function on 404 on JSON ajax request with Jquery?

I want made an Ajax request with response on JSON. So I made this Ajax request : $.ajax({ url: 'http://my_url', dataType: "json", success: function(data){ alert('success'); }, error: function(data){ alert('error'); }, complete: function(data) { alert('complete') }}) This code works goo...

NOOB question... variable for animate value?

I have a variable that I would like to use to use as an animation value in pixels: var thisAmount = maxScrollIncrements*DISPLAY_WIDTH $("#image").animate({left:"+=thisAmount", opacity:1.0}, "fast"); So in this case if "thisAmount" = 1200, I want the equvilant of: $("#image").animate({left:"+=1200px", opacity:1.0}, "fast"); I know t...

jquery not select?

i have a click event for $('#blah div'). div has text inside of it (not inside a div, span, p, etc) and has a textarea in it. The textarea is triggering the event as well, how do i make it only trigger when i click the text and ignore the textarea? ...

jQuery remove selected option from this

Hi all, first post here, I come in peace :) I've searched but can't quite find what I'm after. I am trying to manipulate the selected option of a select box. Can someone please explain why this works: $('#some_select_box').click(function() { $('#some_select_box option:selected').remove(); }); but this doesn't: $('#some_select_box'...

Sending a JSON array to be received as a Dictionary<string,string>

I have a method with the following signature: public ActionResult RenderFamilyTree(string name, Dictionary<string, string> children) I'm trying to call it from javascript using jQuery like this: $('#div_render').load( "<%= Url.Action("RenderFamilyTree") %>", { 'name': 'Raul', [ {'key':'key1','...

can't get height of object in chrome

i want to get the height property of a object: $('.selector img').each(function(index,e){ thisImage = $('#topContent img').get(index); } so long no problem, but then i want to get the height like this: thisImage.height; i thought it was equvivilent to: thisImage.height(); or: thisImage.css("height"); but neither does w...

SimpleModal and Jquery (How to do open and closing animations)?

http://www.ericmmartin.com/projects/simplemodal/ There's two examples near the bottom of the page that show how to either do open or closing animations. I'm pretty new to jquery. How can I declare both onOpen and onClose? (I've only been able to get one to work at a time. jQuery(function ($) { $('a.basic').click(function (e) { ...

how to access generated groupname for asp radiobutton

Hi, I need to access radiobutton groupname in my jquery. However, groupname that's rendered for an asp radiobutton is kind of different. Example: <asp:RadioButton runat="server" GroupName="payment" ID="creditcard" Checked="true" value="creditcard" /> will generate: <input type="radio" checked="checked" value="creditcard" name="ctl...

Each Click I want to increase the font size using jquery

Hello, For each click I want to increase the font size. $('#fontplus').each(function('click') { var fs = $('#bod').css('font-size'); $('#bod').css('font-size',fs+1); }); <div id="fontplus">+</div> Thanks Jean ...

Is there a way to turn off auto-complete on an input-field using jQuery?

Is there a way to turn off auto-complete on an input-field using jQuery? Like this: <input type="text" autocomplete="off" /> ...

Opening href in jQuery Dialog

Okay, so I've got the following code to create a dialog of a div within a page: $('#modal').dialog({ autoOpen: false, width: 600, height: 450, modal: true, resizable: false, draggable: false, title: 'Enter Data', close: function() { $("#modal .entry_dat...

jQuery append value to html input depending on other input

Ok, the title is a bit confusing, but here's my predicament. I've made a web app to track UPS packages internally at work. Currently, you input the tracking number and then select the city it was shipped from. All tracking numbers from an account start with the same X amount of numbers. So if someone entered "1Z8473..." into one input, "...

jquery selector help... thought I followed the example correctly...but can't get it to work..

I'm trying to do the following in jquery but can't make it work . I want to select all the DIV tags that have a custom attribute called NODE_ID that have a value of 49_3. then select the and change the src attribute to a different image. Here's the HTML: <div style="display: block;" id="71_7_sub_p_div" node_id="49_3"> <span> ...

Function in JS returns undefined

Hello there, I have the following problem. The alert allways returns undefined, but I know it has a value. What am I doing wrong. I'm out of solutions... I'm using JQUERY jquery-1.4.2.min.js Tnx in advance $(document).ready(function(){ $('#generateButton').click(createIBAN); }); function createIBAN(){ //---- First check if a...

jquery fullcalendar and week calendar

How to get week calendar add event function in fullcalendar? ...

Render view as string when Ajax request to view is made

I have my views render to route requests like /controller/action (for instance, /Page/Create), so pretty classic. I am creating a form where view will be loaded through AJAX request with jQuery get(), so essentially I need my Views or to be precise, my controller actions, to return plain HTML string when an AJAX request is made to the r...

jquery - strange behavior in IE..

** Rephrased ** Fails on Load in IE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd&quot;&gt; <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Test</title> <script type="text/javascript" src="lib/jquery/jquery-1.3....

Firebug and jQuery selectors in an iFrame

Hi all, I'm working on a web application and using the jQuery plug-in Colorbox to pop up a window that presents a form for editing elements of the parent window. I'm using Firebug to debug my Javascript and jQuery, and I noticed that I can't select an element in my Colorbox HTML form using the jQuery console command line. For instance: ...

How do I force a jQuery click event to proceed any control click event on ASP.Net page

I've found posts about making a click event with jQuery for a button, however I need a little more then that. When any postback occurs on a page, I need to fire off a jQuery click event. Based on a condition, I want to continue processing (including running the server-side event code after the jQuery code), or, perform a redirect. I'm...

Validating javascript decimal numbers

I'm using the following regexp to validate numbers in my javascript file: var valid = (val.match(/^\d+$/)); It works fine for whole numbers like 100, 200, etc, however for things like 1.44, 4.11, etc, it returns false. How can I change it so numbers with a decimal are also accepted? ...