jquery

jquery - why does $.ajax call the success handler when the request is aborted because my server is down?

When I bring my server down and make an ajax request to it, firebug shows that the request is aborted a few seconds after making the request, and my success handler gets called. Why does the success handler get called, shouldn't it be the error handler? And how can I reliably detect that it wasn't actually a success? CODE: ...

What is wrong with selecting with my drop down element.

<html> <head> <script type='text/javascript' language='javascript' src="http://localhost/javascript/jquery-1.4.2.js"&gt; </script> <script type='text/javascript' language='javascript'> $(document).ready(function(){ $("#button").mousedown(function(){ dropDownMenu = $(...

JQuery UI Autocomplete, value after select (by mouse) is different than (by arrow-keys)

Hi, I'm using jQuery UI Autocomplete 1.8.1 with Jquery 1.4.2 and I have this issue. At first, I can't force the value of the Autocomplete input field, well this is not a big problem. But I have this issue with it: I doesn't act similarly when a user select a choice using mouse to using keyboard arrows. When using keyboard everythin...

how to count Google Buzz followers

How can I get a user's Google Buzz follower count? Can I use jQuery or something else? ...

jQuery - Animate & Time interval

<script> $(document).ready(function() { $.get("database.php", function(data){ var xp = data + "%"; $('#exp_bg').animate({ width: xp }, 1500, function() { }); }); }); </script> Database.php: <?php $xp = 50; $level = 100; $xp_percent = $xp * 100 / $level; echo $xp_percent; ?> What i'm trying to do, is that if $xp_pe...

Best way to change jqGrid rowNum from ALL to -1 before pass to a web service

I'm looking to find the best way to allow users to choose to show ALL records in a jqGrid. I know that a -1 value passed for the rows parameter denotes ALL, but I want the word "ALL" not a -1 to appear in the rowList select element, ie. rowList: [15, 50, 100, 'ALL']. I'm passing the grid request to a web service which accepts an int fo...

Jquery, get div width when overflow: hidden;

Hello all. How can I get a div width when the div is inside another div with "overflow: hidden;" ? I tried to set overflow as auto and after using $("#divselector").width() but I always get the parent div width! Ex: html: <div id="content"> <div id="item">content content content ...</div> </div> css: #content { ...

Get variables in c# from ajax call

I've got an Ajax call for log in here is the code: //if MOUSE class is clicked $('.mouse').click(function () { //get the form to submit and return a message //how to call the function var name = $('#name').val(); var pwd2 = $('#pwd2').val(); $.ajax({ type:"POST", url: "http://localhost:51870...

Jquery: Selecting specific characters/copy..*real* content not DOM elements

I'd like to be able to run a search for the copyright, reg and tm symbols that were pasted in along with copy from something like Word and replace them with the proper html encoding such as So far, I can't find out how to say, Look in the entire document for " ' " and replace it with "&rsquo'" The only methods that get near only selec...

How do you add objects to a javascript namespace?

var Test = (function() { return { useSub: function () { this.Sub.sayHi(); }, init: function () { $(document).ready(this.useSub); } }; })(); Test.Sub = (function () { return { sayHi: function () { alert('hi'); } }; })(); Test.useSub(); /...

How can i lock the main document's scrollbar and force a certain div's scrollbar to be used instead?

i would like to be able to lock the scrollbar and have a different one used instead. this is because i have an overlay div .overlay { opacity: .8; filter: alpha(opacity=80); position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 600; display: none; background: #000; } and a po...

Fadeout a tiled background image in load using JQuery

Hi, I've used JQuery in the past to fade divs in and out successfully. However, I have encountered a situation I can't quite wrap my head around: I am coding a site for a designer who has based the formatting of all the elements on a grid pattern he's created. As he wants the pattern elements to be the same size independent of the brow...

jQuery sequence

$(".item").each(function(){ var item_link = $(this).find("a").attr("href"); $(this).prepend('<div class="img_url"></div>'); var img_url = $('div.img_url', this); $.get(item_link, function(data) { var src = $('.poster img', data).attr('src'); img_url.html(src); }); }); Each .get should be started afte...

jQuery DatePicker - Choose Next Weekday if Current Date Falls on Weekend

Hi all - I know how to gray out the weekends on the jQuery Datepicker by instantiating it like this: $('.calendar').datepicker({ beforeShowDay: $.datepicker.noWeekends }); The Datepicker also automatically selects the current date, so if the current date happens to be on a weekend, nothing is selected. How can I make it select the nex...

What do you do if a webservice in unavailable when updating a dropdown?

I am populating a dropdown from a jquery ajax call to a web service that is returning json data. If for some reason the webservice fails or is unavailable how do I handle this? I don't want to have my users looking at an empty dropdown. How can I cache the last successful call and use that instead? ...

Loading an FLV in Facebox with jQuery for IE7 and IE8

It goes almost without saying, this works perfectly in Chrome, Firefox, and Safari. IE (any version) being the problem. Objective: I am trying to load JWplayer which loads an FLV from S3 in a Facebox popup. jQuery(document).ready(function($) { $('a[rel*=facebox]').facebox() }) HTML (haml): %li#videoGirl = link_to 'What is HQcha...

jQuery replace first string match

I have an array, like var acronyms = { 'NAS': 'Nunc ac sagittis', 'MTCP': 'Morbi tempor congue porta' }; I need to find first match of each acronym and wrap around with tag via jQuery. E.g. <div id="wrap">NAS dui pellentesque pretium augue. MTCP pellentesque pretium augue. NAS ac ornare lectus MTCP nec.</div> becomes <di...

Slick PHP based image manager for managing user profile images

Hi, I'm just throwing this out there as I'm plodding my way through creating a Member Photo album on a site i'm working on, where they can login and upload their photos to a personal gallery. I want this to be nice and lightweight, but still slick and "modern" with a modal based interface for the user. I'm surprised though that there is ...

Catch/Intercept all mouse clicks

I have this simple script that catches all mouse clicks, unless you click on something that actually works. Links, flash videos, etc. How can I adjust this so no matter what a user clicks on, before the video loads, new page loads, etc. It sends the simple GET request I built? (function($) { $.fn.saveClicks = function() { $(this).bin...

pines notify container

I am using Pines Notify plugin for jquery and would like to us it while using jquery dialog that has an iframe.Currently this works except that in put the growl message inside the iframe rather than on the parent. Does anyone out there know how to apply it to the parent about it. ...