jquery

Static variables in an anonymous function

Hi, I'm trying to mimic static variables on a JavaScript function, with the following purpose: $.fn.collapsible = function() { triggers = $(this).children('.collapse-trigger'); jQuery.each(triggers, function() { $(this).click(function() { collapse = $(this).parent().find('.collapse'); }) }) } How do I save the "co...

jQuery question

I am using jquery so that when the user clicks a link I get the id of said link then use it to select a li item with the same id and animate it. Well, at least that's what I'm trying to do...so far I have: $(function(){ $('#slider-buttons a').click(function(){ var x = $(this).attr('id'); var y = $('#slider-stage-list l...

Javascript callback function issue.

Background I'm writing an asynchronous comment system for my website, after reading plenty of tutorials on how to accomplish this I started building one from scratch. The comments are pulled using a JSON request and displayed using Javascript (jQuery). When the user adds a new comment it goes through the hoops and finally is sent via ...

Deleting a section of text from an RSS feed

Twitter's RSS feed displays names as: <name>johnDoe (John Doe)</name> Is there a way to use php or javascript (preferably jquery) to delete everything starting with the first parentheses and after? I only want to show the username and not the username and the person's actual name. Other details: I'm parsing an RSS feed into a page ...

Html scroll: how to avoid it to "cut" my inner elements

Hi, this question is for an autocomplete drop down list I have to do that will fire while you're writing in an html textbox. It basically consists of a div containing the suggestion elements, each of them being a div as well. I got to the point where it's begining to work properly but now I added a vertical scroll to the containing di...

What is fastest children() or find() in jQuery?

To select a child node in jQuery one can use children() but also find(). For example: $(this).children('.foo'); gives the same result as: $(this).find('.foo'); Now, which option is fastest or preferred and why? ...

How to submit form data use jquery form in asp.net ?

i want to get the response value,but there is not response when i click the button; why don't submit the form in asp.net????? my code: <script type="text/javascript"> $(document).ready(function() { var options = { target: '#htmlTarget', dataType : 'json', url : 'Response.aspx', ...

Audible 'click' in IE when using the jQuery .click() event and <a href='#'/>

I often use links with href='#' when calling ajax resources. I noticed that IE makes an audible "click" when clicking these links. Here's a workaround: $("#element") .click(function(){return false;}) .bind("click", function(){ alert(this); }); HOWEVER, when I try to encapsulate this functionality in a jQuery plugin, I'm not succes...

sIFR swf implementation problems

Hi I have tried a few methods of sIFR implementations, but I cant get it to work 100%. I would really appreciate any help or tips on this issue. I have mainly tried to use sIFR 3 (r436) and I get it to work with the rockwell.swf that is supplied in the example, but I can't get it to work with any other .swf-file The font I want to us...

How do I monitor the DOM for changes?

Is there a way - using jQuery or otherwise - to monitor the DOM for insertions, deletions, updates to styles, etc? ...

How can i change the background image of a list item

I want to change my <Li> bgImage onMouseOver using jQuery But image is in three div tags ...

ASP.NET LinkButton / ImageButton and JQuery Validate?

We are introducing JQuery to an existing ASP.NET application and use the Validate plugin for JQuery to do the client side validation (we do not want to use the asp.net validators). Everything works nicely with the asp:Button control. The client side validation is triggered before the page is submitted. However when using the LinkButto...

Completing jQuery animations on page unload

Is there a way to perform a jQuery animation before a user navigates away from a page by clicking on a link, or clicking the back/forward buttons. It seems like doing the animation in response to an unload event would be sure to cover all the conditions under which a user may leave a page. However, the new page is loaded before the a...

javascript dropdown

I am not sure what I am missing here. this is the code I have placed: <script type="text/javascript"> $(function(){ $(".category_list").hide(); return false; $("#sol-surface").click( function() { $(this).next().toggle(); return false; }); $("#nat-stone").click( function() { ...

Simplest JQuery validation rules example

The following HTML form successfully utilizes jQuery's form validation, displaying "This field is required" to the right of the form field if left blank, and "Please enter at least 2 characters" if fewer than 2 characters were entered. However, instead of the validation metadata being specified using the class and minlength attributes o...

Cache AJAX requests

I am sending AJAX GET-requests to a PHP application and would like to cache the request returns for later use. Since I am using GET this should be possible because different requests request different URLs (e.g. getHTML.php?page=2 and getHTML.php?page=5). What headers do I need to declare in the PHP-application to make the clients brow...

Jquery encompas AJAX? Thoughts?

With .NET 4.0 on the horizon will MS AJAX still have a place or do you think JQuery will expand to to include the full functionality of AJAX and make, MS AJAX as we know it redundant? ...

jQuery: Adding context to a selector is much faster than refining your selector?

I just noticed that adding context to the selector is much faster than refining your selector. $('li',$('#bar')).append('bla'); Is twice as faster than: $('#bar li').append('bla'); Is this generally true? ...

How to have jQuery restrict file types on upload?

I would like to have jQuery limit a file upload feild to only jpg/jpeg, png, and gif. I am doing backend checking with php already. I am running my submit button through a javascript function already so I really just need to know how to check for the filetypes before submit or alert. Thanks! ...

How to set the row class of a table based on cell content using jQuery?

I have the following table: <table class="grid"> <thead> <tr> <th>Name</th> <th>Status</th> <tr> </thead> <tbody> <tr> <td>Project 1</td> <td>Closed</td> <tr> <tr> <td>Project 2</td> <td>Open</td> <tr> <tr> <td>Project 3</td> <td>Closed</td> ...