jquery

jquery, prevent onclick=window.location on parent element

I have a table with data such as this: <table> <tr onclick="window.location='download.php?id=1'"> <td>Program 1<br/>Short Description 1 (<a onclick="$.popup.show('Install Instructions', 'Instructions pulled from DB here')">Instructions</a>)</td> <td>Added by user and date/time here<td> <td>Filesize here<td> <td><a href="edit.ph...

rails jquery ajax form validation

I'm looking to do some ajax form validation with jquery. Everything is in place and I can return my errors in a json object that looks something like this: errors => { "first_name": "cannot be blank", "password": "cannot be blank", "last_name": "cannot be blank", "email": "cannot be blank"} This works fine if I just want to display t...

How to make FF and IE act the same when pressing the back button with hash marks#

Im using a jquery accordian that uses hash marks to differentiate between open accordion tabs. demo page http://sandbox.unwrongest.com/jquery.accordion/ When clicking through a few tabs then using the back button, Firefox only displays hash values changing. In IE the hash values don't change with the back button and goes directly to...

Hide div after a few seconds

Hello guys, I was wondering, how in jquery am I able to hide a div after a few seconds? Like Gmail's messages for example. I've tried my best but am unable to get it working. Thanks! ...

Alternative to document.getElementById().setAttribute() function

Is there any alternative to doing the following line: document.getElementById("btn").setAttribute("onclick", "save(" + id + ");"); This line basically changes the onclick() event of a button to something like: save(34); , save(35); etc. However it fails in IE 7 and 6 but works in IE 8 and Firefox. I can use jquery for this as well. ...

jQuery UI Dialog confirmation...

I'm trying to use the jQuery UI Dialog to display a confirmation prior to executing the action...in this case navigating to the selected link....but in another case, I might like to use AJAX delete. I thought I could pass the action as parameter of the custom_confirm function: $("a.edit").click(function(e){ e.preventDefault()...

troubleshoot authentication error

Symptom: Some users cannot successfully POST, most can successfully POST. When the error occurs, users are redirected to the site's Shared/Error page. Technologies used: IIS v6 Windows Server 2003 asp.net v3.5 asp.net mvc framework v1.0 jQuery linq sql server 2005 Authentication: Windows with the AspNetActiveDirectoryMembershipProvider...

Need JQuery to select a table only if its 1st row has more than 1 column

I need to select and act on a table element with JQuery, but only when it contains at least one row with more than one column. The following selector works, but only gets me part way: $('#my_table_is:has(tbody tr)').doSomething(); Variations I have tried with no success are: $('#my_table_id:has(tbody > tr > td:eq(1))').doSomething();...

Issue with jQuery $.get in IE

I have a login form which appears at the top of all of my pages when the user is logged out. My current jQuery/javascript code works in Firefox 3 but not IE 7. The code queries a page which simply returns the string "true" or "false" depending on whether the login was successful or not. Inside my $.ready() function call I have the fol...

DOCTYPE problem, jQuery

Scroll.js is used for #bird block, which follows the page scrolling. The main problem - it is working, if I remove the Doctype line, this one: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; and it doesnt work if doctype is on. Here is the html: <!DOCTYPE ...

Interaction with a database: JQuery Ajax, Web Services

Hi, I am trying to retrieve values from a database by using JQuery Ajax to call a web service routine. The web service routine is set up properly and returns the value I require, however I'm confused about how the jquery ajax works... I don't know how to retrieve the value $.ajax({ type: 'POST', url: 'myservices.asmx/ge...

Problem waiting til function has finished executing before it tries to execute again...

Hi, I'm using the $(window).scroll(); to specify a function to be call for when the user scrolls too close to the top or bottom. The function takes a second to execute, and if they continue scrolling, it executes multiple times before the first one has even finished. Is there any way I can let the function start executing and then te...

jQuery: The 'body' element is activating the scroll event twice

Hi guys, I've implemented an animation for my photo blog. I still have big problem because the 'body' element is activating the animation twice. I think the problem stems from the $('body').animate. Because I think that when the body is animating, the scroll event would be activated again and thus triggering the event twice. The proble...

Please help to fix jQuery scrolling

Page must be scrolled after clicking on link with id (let it be #link). Here is my code, which doesnt work: $(document).ready(function(){ $("#link").click(function () { $(this).animate({ scrollTop: 2000 }, 'slow'); }); }); But this one works, after the page loads it slowly scrolls to the bottom of the page: $(document...

fadeOut a content using jquery

How can i fadeOut a div using jquery ...

How can i load a picture with jquery?

Hi, i am currently working on a class that generates diagramm's as pictures with php. I want to load these pictures dynamically with jquery. How can i do that?? I wont have a real picture file, just the content of the file when i call it with ajax... And i cant simply define the phpscript as the src because i need to pass Post Parameter...

How do i use JQuery Autocomplete for multiple words

I have an autocomplete field and am just wondering how can i use it for multiple words? When i type the first word it works perfect, but when i space and type in the second word, its sends the two words back to the server and of course the results are wrong! eg. when i type the two words, 'Java javascript' the first word 'Java', autoc...

how to disable jquery date picker on radio button

Hi guys, I am new to jQuery. Any help would be appreciated I have two radio button and two text box in which i displayed the date using jquery. When i click on Radio1 then in both the text box i should be able to select date but when i click on Radio2 then i shouldn't be able to select the date in text2 field. text2 field should be dis...

Using $.post within a javascript function, cannot assign value to a variable?

Hi, I'm trying to use $.post within a function, get the results, then return the function true or false based on the results of the $.post callback. However, the callback seems to occur, AFTER the return event of the parent function. Here's the current code the ret variable is always undefined but if I alert() it within the $.post callb...

How to preserve text selection when opening a jQuery dialog

Using jQuery's dialog I came across the following quirk (tested in FF3): User selects text In code, open up a jQuery dialog BUG: the text gets unselected (text could be in a textarea or just an HTML on the page) So, to me it seems like a funny (and annoying) bug or a quirk, but maybe there's a good explanation for that. And what int...