javascript

Possible JavaScript Error?

My QA specialist is getting this following bug: Opening & closing the Country dropdown along with other dropdowns: Toggle opening Country & Phone Type drops. Message: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus. Is this an issue with the JavaScript. And if so I have ...

How to detect IE7 with javascript or jquery and add a class to div.

Is there any way to detect IE7? I don't have any problems with my codes in IE8, but I have a problem with IE7. So what I thought is that I can add a class with jquery when a browser is IE7 detecting it by javascript. I want to change from <div id="system"> to <div id="system" class="ie7"> Thanks in advance. ...

howto "submit" a part of a form using jQuery

I'm got a form laid out like a spreadsheet. When the user leaves a row, I want to submit fields from that row to the server using jQuery Ajax. The page is one large form, so this isn't really a javascript clicking the submit button scenario - the form is huge and I only want to send a small portion of the content for reasons of speed. I...

jQuery: Is there any reason not to store DOM elements in a variable instead of attaching them to the DOM?

I've got a plug-in I'm working on which fetches a portion of a remote page, and saves that portion to be used in a jQuery UI dialog widget; originally I was attaching the HTML to the DOM and hiding it with display:none until it was called with $.dialog but I realized I could just leave the DOM node in a variable. Is there any reason no...

Implementing SproutCore-like bindings in a JavaScript Web application

I've done the SproutCore tutorial and have an idea of what the framework has to offer. It seems amazing, although I'm not sure how I feel about a framework which generates the HTML and CSS behind the scenes. The thing about SproutCore which I find most appealing is its bindings – reducing the amount of glue code required to keep everythi...

JavaScript Scope question

As someone who is attempting to take a more object oriented approach to my javascript programming I've hit a stumbling block which I'm sure is probably something very basic, but, take the following object implementation (assume that the jQuery object is available to this code): function Foo() { this.someProperty = 5; } Foo.prototyp...

Can Use JQ Insted of PHP for Webdevelopment.

can we use JQ insted of php for developing website. which one is more preferable. I think we can also use JQ for web development.Using JQ we can Execute MySql query like php. Which One is better? and why? ...

Are there keyboard shortcuts for the Safari debugger?

Firebug and eclipse both let me step through code using function keys. Does Safari have equivalent capabilities? ...

How Can i optimize qTip?

Hey everyone! i've been doing some profiling on an app i'm working on and qTip is really slowing it down! I love this plugin but adding the tips on document ready is taking almost 2 whole seconds (about 300 tips on the page). I know it's a lot of tips, but is there anyway obvious or not so obvious ways to speed this up? i'm using th...

resize content div + image on browser resize

What would be the best way to resize a content div to match the browser, keeping a white margin around it, whilst also resizing an image contained within it, so that it keeps a good aspect ratio? this is the effect i am looking to create: http://www.louisvuitton.com/ ...

CLose Window in Javascript

Hi, I need a way to close the browser (not a pop up) using Javascript. Is it possible? ...

Getting screen reader to read new content added with JavaScript

When a web page is loaded, screen readers (like the one that comes with OS X, or JAWS on Windows) will read the content of the whole page. But say your page is dynamic, and as users performing an action, new content gets added to the page. For the sake of simplicity, say you display a message somewhere in a <span>. How can you get the sc...

how to append link to text block using Safari Extensions

I'm trying to create a safari extension that will place an "Add to BibDesk" link after any text that looks like a BibText entry. BibText entries look like this: @string{ foo = "bar", foo2 = "bar2" } I know how to construct the necessary regex, but my question is what's the best way, using javascript, to search all the text o...

Handling standard user facing scenarios

*I was wondering if i could do all these in javascript, as opposed to having rails helpers In my application, there are several types of "if-else" UI cases. This is a fairly common scenario, and i wonder if anyone has a tidy way to do these? EG 1) There might be several types of links with the same behavior: "upvote", etc. If i...

MooTools: Attaching event to multiple elements

I've got a jQuery routine I need to convert to MooTools, but I can't get it to work. Here's my jQuery version: $(".google-analytics-link").click(function () { var href = $(this).attr("href"); pageTracker._link(href); location.href = href; return false; }); Here's my MooTools translation: $$(".google-analytics-link").a...

How to run a jQuery Code after loading all the images in my page ?

How to run a jQuery Code after loading all the images in my page ? ...

Controlling the top parent window from iframe with jquery or javascript

Hi, I have a page on my site which has a blank text field. Next to this is a button which opens up an iframe (using colorbox). This iframe shows a list of files - next to each file is a button which puts the filename in to the text field in the parent window by calling the function below: function returnImage(file){ $('#input_text_i...

How do I detect the client has javascript turned on/off from Rails?

I don't want to deal with users who have javascript turned off, so I want to just prevent them from using my application. I want to detect if the user has javascript turned on so I can redirect them to a page that tells them they need to use javascript. I'm sure its in the request header. Anyone have any ideas how I can do this? ...

How to show divs on browser scroll

My page layout has several group of divs repeating like <div--1> <div--2> <div--3> <div--4> Tthis structure repeats over several times. I would like to hide the contents of div--4 to be hidden untill the user scrolls to that element. How can we achieve that functionality? I found a plugin that works with images like...

jQuery tooltip offset

$(document).ready(function() { $("#demo img[title]").tooltip({effect: 'slide'}); }); I want to add an offset to this function, but when i add offset [20, 0], it doesn't work. I would like to know how to code using 2 parameters. ...