jquery

Can you clear a text form with jquery if another form is selected?

My jquery code below switches a state dropdownlist out with a state input text box depending on the country that is selected. It also disables one another depending on which one you select, however I would like to make it not disable the other form field but instead have it clear the contents of "othstate" input box if "usstate" is sele...

How can I determine in JS if a function/method exists in IE7?

I wrote a quick and dirty logger as a jQuery plugin (function($){ $.log = function(debug) { if (console.debug) { console.debug(debug); }; }; })(jQuery); It works fine in Firefox, but in IE7, I'm getting the error console.debug is null or not an object How do I perform a function exists in Jav...

jQuery: Sort a table column not rows.

I want to sort a table by column's head field. Means I want to keep the rows at same place but order of columns should be sort based on column heading field(td). For Example: table before sorting: assign1|assign3|assign2|assign4| assign1|assign3|assign2|assign4| assign1|assign3|assign2|assign4| assign1|assign3|assign2|assign4| assign1...

how to check the age of registrant during registration using jquery

I want to filter all the user who can register in my website. how can i filter the age of the registrant using jquery allowing 18 years old and above, but when the age is 13 to 17 years old they can register but they must check checkbox for parental consent. I am using a textbox with mm/dd/yyyy format. ...

Should I NOT include jquery on pages that do not use it?

I understand that after a browser loads jquery, generally it is added to the browsers cache. My site has hundreds of pages and I have a header file that is included on these pages and only some of these pages use jquery code so I am wondering will a page load faster or have better performance to the end user if I do not include jquery o...

jquery ajax call not working?! firefox or xss problem?

My problem is: in firefox i got no response. in ie it worked fine. I want a ajax call to a local script getting some information in plain text or something else. but it won't work. I think cross scripting should not a problem at this point or? the javascript code is simple: var targetUrl = "http://localhost/jQueryProxy.php"; var parame...

Tiling a asynchronously loaded image - stuck between an <img> and a background URL

For a site with a lot of small thumbnail images, I wanted to use a placeholder gif while each image was loading. This requires code like the following: $('.this_img').each(function(){ var $this_img = $(this); var $this_src = $(this).find('.sliderImage:first').attr('src'); var img = new Image(); // wrap our new image in jQuery...

foreach equivalent of php in jquery?

Is there a foreach code in JQuery as in PHP? I have a code in php,like <?php foreach ($viewfields as $viewfield): ?> if("<?php echo $viewfield['Attribute']['required'];?>"=='true'){ $("<span class='req'><em> * </em></span>").appendTo("#fb_contentarea_col1down21 #label<?php echo $viewfield['Attribute']['sequence_no']?>"); } ...

jquerytools overlay function doesnt seem to exist

Hi there im using overylay from jquery tools, however I cant seem to get the example working I get the following error: "$("a[rel='overlay']").overlay(function() {" is not a function In my HTML file i have the jquery/overlay package then i have "common.js" where I call overlay for all links with rel=overlay // jQuery functions...

JQUERY evaluate a string

Hi all, I wanted to evaluate this script in jquery: var name = "Brian"; var txt = "This is your {name}"; Anyone can help me? I'm very noob for this one. Thanks ...

for( in Array) Error in Jquery while using cakephp variable in JQuery

Hi , In my application , i am trying to use the Php variable in my JQUery . where $viewfields is an array that i retrieve from my cakephp controller. If i tried to use that one like below, i am getting error as for( in Array){\n for(<?=$viewfield;?> in <?=$viewfields;?>){} Please suggest me. What to do so.. Note: i was previously ...

keydown event on a iframe

How i can get keydown event on iframe? ...

Multiple versions of Safari on Windows XP?

Is there any way to run multiple versions of Safari under Windows XP? I'm interested in running Safari versions 3.1 and 4. Specifically, i want to debug this type of problem with Safari 3.1 which does not occur on my current version: http://stackoverflow.com/questions/770669/invalidnodetypeerr-in-jquery-when-doing-multiple-selectors-on...

Simulating "focus" and "blur" in jQuery .live() method...

Update: As of jQuery 1.4, $.live() now supports focusin and focusout events. jQuery currently1 doesn't support "blur" or "focus" as arguments for the $.live() method. What type of work-around could I implement to achieve the following: $("textarea") .live("focus", function() { foo = "bar"; }) .live("blur", function() { foo = "fi...

Find information in a table

I have a table with a thead and couple of tr in a tbody When I click on a cell in a tr, i want to traverse to the text of the cell that is before it For eg if i clicked on Cell 3 of Row 3, i want to find the text of Cell2 of Row 3 How i do it? Edit: I cancelled my edit. I will open a new question to avoid confusiing user who helping ...

Weird browser / ajax error : Extra junk appears at the end of javascript files in firefox

This is a weird one. We're writing a Django application with some rich javascript UI, using both Yahoo YUI and jQuery. Our main page template now includes a fair number of js files. And we're starting to see a strange error in Firefox (3 and 3.5) . Sometimes the javascript crashes. And inspecting in Firebug we see that a syntax error o...

Cross browser text area for chat

I need an cross browser text area for web chat that support HTML . Can we create it with jquery ? ...

Download or just save an image file from a website using js

Hi friends, I want to download or just need to save the image file from a website using the javascript in pure coding itself.. Because i want to download nearly 1000 jpeg, so i would like to write a function to call and download those images. URL is available, from that i want to download the specific image Please guide regarding this...

JQuery Element Opacity Setting

Hello, I have a list of images which are all set to 40% opacity when the DOM is loaded. I need the first of these images to remain at 100% opacity as the others fade down. My code is as follows but I can't seem to get the first image to remain at 100%. $j(document).ready(function() { fadeDownImages(); fadeDownImages = fun...

Can I create script tag by jQuery?

I want to create a script tag by jQuery. I use the following code: $("<body>").append("<script></script>"); It doesn't work. What will you do to acheive it? ...