jquery

jQuery.get() function not executing

I'm hijacking the click event and doing a $.get() on the href. Problem is, that the function that I'm defining doesn't get executed. Firebug Console, shows that a GET request was actually made: GET http://localhost:8000/products/a-26-tavella-grip-168168-1a-3/ 200 OK 12ms So, not sure what to make of this, the page is just a simpl...

IE 6: How to debug event not firing

For whatever reason, SOMETHING is preventing an input text box's focus event from firing when clicking into the box, ONLY in IE 6, in our jQuery site. (Tabbing to the box actually does fire focus). Any suggestions on how to debug this? I have no idea what's happening. I've removed all the events from the input box except the focus an...

What Are The Most Popular jQuery Plugin Patterns?

I'm writing an open-source mini-book on jQuery Plugin Development Patterns and am interested in hearing what you guys feel are the most popular plugin patterns at the moment. (If you could provide an example too when answering that would be a big plus) There are at least 4 unique ones which I've identified so far, including DRY, but wha...

Select the parents of a DOM object, and Exclude the Children of the selected parents

I'd like to display a dialogue when a user clicks out of the DOM object that holds my app. I was thinking, I'd just put a one time click event on all parents and then trigger the dialogue with that. Because the DOM object that I'm getting the parent's for is included, it's triggering the dialogue even when the object it's self is click...

jQuery .post not executing task in URL

Hello, My issue involves jQuery .post and Joomla. I have a template with a form that is within one of the accordion areas (using jQuery UI accordion). I have a button type=submit in the form. The form html is generated via jQuery when a user clicks a button in the accordion area. When a user clicks the form submit button, the event ...

variable image width/height based on screen size

I'm working on a touch panel web page (for my home automation) that is going to run on both the iPad and the iPhone. What I'm wondering about is the ability to dynamically set the size of my touch icons based on the screen size. If I'm on the iPad, I need the icons to be 150px by 150px, but if I'm on the iPhone, I need the icons to be ...

function with jquery ajax in it not returning value

This function wont return any value, even though the ajax call goes through correctly Function: function queryData(request) { var ret = null; $.ajax({ url: 'ajax.php', data: 'requestdata='+request, dataType: 'json', type: 'post', success: function (j) { if(j.ok == true) ...

jquery flot pie slice color

I can't figure out how to get flot.pie to change the pie slice color, just the series color. Is this possible? ...

When the user clicks an element: Prevent default action, present menu(s), then resume default action when menu is clicked

Goal When the user clicks an element (with class="menu"), the default action should not be executed. The user should be presented with a menu with options. When an option has been clicked, then the default action should be executed. Problem It's very problematic to stop the original click event in the first place, because it seems imp...

How do I get at the raw JSON response from a jQuery $.getJSON() request?

How do I get at the raw JSON response from a jQuery $.getJSON() request? I just want to print the raw response in an alert() dialogue in my browser? ...

Help me optimize this jQuery :has selector

I'm using dynaTrace to profile my application in Internet Explorer. One of the most expensive calls is the following: $("div.containerClass:has(div.containerHeader)") I scoped the selector as follows, which offered a little improvement: $("div.containerClass:has(div.containerHeader)", "#section-wrapper") How can I improve the perf...

JQuery UI Toggle

I am trying to get JQuery to give me the following setup. One listbox contains three options. One of these options, when clicked, will reveal a div. Either of the other two options reveal a second div. I am using JQuery UI/Toggle: http://jqueryui.com/demos/toggle/. For example: <%= javascript_include_tag "ui/jquery.effects.core.js", "ui...

Textarea : elem.val() vs elem.text()

This is very weird. Apparently, I can use both .val() and .text() to manipulate textarea text. But after I use .val to change the text, I cannot use .text anymore. The converse is not true. This is leading to some funky bugs. The reason is because a plugin i am using might be using .val to manipulate the text. Can anyone explain how ...

Replacing selected text in the textarea

Hi folks, what is the best way to do this in jQuery? This should be a fairly common use case. User selects text in a textarea He clicks on a link The text in the link replaces the selected text in the textarea Any code will be much appreciated - I am having some issues with part 3. ...

Google News, Left Nav CSS Trick? or jQuery Trick

Hello, I'm new at this. Check out Google News... notice the left nav when scrolling up and down the page. See how is scrolls for a little bit but then sticks to the top of the page before it goes away? Any ideas on how that is done? Can jQuery and CSS replicate that? If so, any tips? ...

loading gMaps data into Fancybox help

I have an address and a little map icon and when the user clicks on the icon it loads up Fancybox with the gMaps data in it. Now, at first I tried to see how I could have my <div id="map"></div> load into the Fancybox modal. After trying like for ever to figure this out with ever API option available to me from Fancybox.net I gave up ...

Is there any way to load json from a subdomain?

I'd love to stash some .json files on a CDN a la static.mydomain.com. Truth be told, static.mydomain.com is a CNAME in front of an Amazon S3 bucket. I understand this violates the JavaScript security model. Is there an advised workaround or design? I've seen server-side stuff suggested like a PHP script to suck down data via cURL or fil...

Jquery/Javascript: what does the " i " in " (function(i){ " do/mean? How does it know that?

In the example below, the Jquery code changes the src of the images on the page to start with "test", and end with ".jpg", but what tells it what i is? if i'm correct, i could also be number, or e, or z, or n, or whatever word or letter i want, so, by placing that i in there, is it saying that i is the current object? or the name of the ...

Can't seem to add checked attribute to checkbox via jQuery?

Edit I just tried adding this.setAttribute('checked', 'checked'); and it seems to work. Of course just minutes after I make this post....Anyone have any ideas why jQuery's attr() method didn't work? I can't seem to add a checked attribute to a checkbox via javascript. What I'm trying to do is retain state (via localStorage) of some for...

jquery assign plugin to dynamic created object

Hi All, I have this script <input type="Button" class="button-calendar" value="add"> <ol class="ol-calendar"> <li><input type="Text" class="text-calendar" name="calendar_1" id="calendar_1"></li> </ol> <script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="../js/jquery-ui-1.8.2....