jquery

jquery gettings variables from img src rather than window.location.href

I found this snippet of code, which works a treat: $.urlParam = function(name){ var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href); if (!results) { return 0; } return results[1] || 0;} } So if the url/query string was xyz.com/index.html?lang=de just call var langval = $.urlParam('lang'); an...

How to detect 404 error in a url then set the url image to display:none using Jquery

Hello, I have a table which repeats an image link to a file download for every row of data. I want to use Jquery or Javascript to detect if a image link returns a 404 error, meaning the file its trying to find doesn’t exist, then set the image link to display:none so its hidden. Any help is much appreciated! Jamie. ---Edit--- This i...

jQuery and validation error messages

<div class="QuestionWrapper"> <asp:Literal ID="litOtherReasonDescription" runat="server"></asp:Literal> <div class="Question"> <label for="">Other Reason Description</label> </div> <div class="Answer"> <asp:TextBox ID="txtOtherReasonDescription" CssClass="txtOtherReasonDescription required" runat="server" ...

Quickest way to get around not being able to drag on an iDevice?

I have a site that uses a jQuery UI slider. I fired it up in my iPhone, and realised that when trying to drag the slider (by dragging my finger over it), it scrolls the site left to right and leaves the slider unaltered. It appears I can only slide when the site is at a zoom level that shows the entire page. I think you can force this ...

How to remove unchecked check-box values from cookie using jQuery?

I'm trying to write a script where the unchecked values of a set of check-box are removed from a cookie. I am using jQuery's cookie plugin below is my current function which is called when a check-box is called; <script type="text/javascript"> jQuery(document).ready(function($){ $("input[type=checkbox]").each(function () { $(...

Shift+Click Event Woes

Hi there! I'm sure i'm doing something terribly stupid for this not to work, but I can't get my shift event to fire. I've tried both: $('.ShowCannedReport_UserFilterDropdown').each(function (index, element) { $(element).bind('click', function (event) { if (!event.shiftKey && !event.ctrlKey) { ShowCannedReport_Us...

jquery UI slider to move multiple divs

Hey i want to use jquery UI to have a slider on my page that moves multiple divs different distances. So basically you pull the slider and div1 moves 10px left and div2 moves 20px left. I have taken a look at the jquery UI slider here http://jqueryui.com/demos/slider/#side-scroll but i cant figure out how to get that slider to move mul...

how to get actual content of an object after being replaceWith('something') in jquery

I have this code $(document).ready(function(){ $('.selector').click(function(){ obj = $(this); obj.replaceWith('<div class="size">whats up man ??!</div>'); alert(obj.html()); }); }); I want to get the new content of 'obj' that has been 'replaceWith' but, I get the old content instead ... how do I get...

remove unwanted styles from objects using jquery (or php)?

Hi all, I was wondering if there was any way of removing unwanted style attributes from objects (p, ul, li etc), as for some reason my client has decided to copy/paste information from word into a wysiwyg and doesn't bother removing the crap that comes along with it, I was wondering if jquery could do this? Here's an example of the ou...

Mechanize in Jquery

I am adept in Ruby WWW::Mechanize. And I was wondering if a jQuery equilavent exists ? ...

Ajax call before jgrid is loaded

Hi. I need to pre-load some values from a php script, I'm using a $.post call (jquery) as follows: ... var grade, section,from,until,user; function loadData(){ $.post('procstring.php', {data: window.location.hash}, function(result){ grade = result.grade; ...

disable button when first click in jquery

I want to disable button when user first click it so it must not save multiple record if a user have a slow connection. Im using asp.net mvc2 ...

how to fetch return values between jquery functions and post ajax jquery request to webservice

I have the following code where the function codeaddress geocodes the text feild value and returns geocoded value , geocoded value is stored in variable example ,how will i return the variable v2 to the function call and post to asmx webservice. <script type="text/javascript"> $(document).ready(function() { $('#SubmitForm')...

JQuery wait message dialogue

Hi all I'm looking for a jQuery plugin which works like the Ext.MessageBox.show(config) with the wait property set as true. It should be a modal dialog with a message and progressbar. I've done some search on this and found some widgets like jQuery UI imProgressBar Matt Berseth's but none of them provides the functionality like th...

Adding hoverIntent to jquery dropdown

Bit of a jquery Newbie here, so go easy. Basically I'm trying to plug hoverIntent into this dropdown menu: http://www.sooperthemes.com/open-source/jquery/jquery-sooperfish-dropdown-menus I've been stuck with this for a few days now, and I know it's probably very simple, but I can't seem to find the right selector to apply the intent f...

Grid of checkboxes represents a many-to-many db relationship; the best way to get from webform to database (not passing go, not collecting £200)

I am using jquery/jsp/java ejb3.0/sql server. The User interface requirement (a jsp page) is a grid of checkboxes, ~10 rows high and up to about ~30 rows wide (this varies), it represents a linker table for a many-to-many table relationship. The checkboxes will be populated from the database (if row present in linker table, checkbox ch...

jQuery Error: Invalid object initializer

Hi, I have the following code in my page: <div id="data_body_container" style="overflow: auto; width: 880px; height: 500px;"> ... </div> and then below in the site: <script type="text/javascript"> $(window).resize(function() { var windowWidth = $(window).width() - 50; var windowHeight...

jQuery Toggle Cookie

I have the following code (Yes I know it's quite long winded, but I want to keep it as much the same as possible) Hopefully it will make sense, but essentially what I want to do is when a user clicks one of the toggles it will create the relevant cookie and set its value to "Open" and then when they click it again it remove the cookie. ...

Jquery separate decimal number

If I have decimal numbers like: 18.1234567 5.2345678 -77.7654321 -0.4567891 How can I separate number before and after decimal dot using Jquery and is there any function that can recognize negative value of the selected number? ...

Appending dynamically generated html using jQuery does not play well with Fancybox

Hi folks. I'm using Fancybox (http://fancybox.net) to pop open an iFrame. In order to do so, I create a link with a class set to "item_pop" as so: <div id="events"> <a href="http://www.example.com" class="item_pop">My Link</a> </div> I then have some JavaScript in the footer that supports this: jQuery(".item_pop").fancybox({ ...