jquery

Scope problem with nested $.getJSON

$.getJSON('http://twitter.com/followers/ids.json?screen_name=/…'+ query1 + ' $.getJSON('http://twitter.com/followers/ids.json?screen_name=/…'+ query2 + ' f2=data1; f1=data; for(var i=0; i "less than" f1.length; i++) { for(var j=0; j "less than" f2.length; i++) { if ...

JQuery Accordion Activation

Is there another way to activate an accordion menu besides the .accordion('activate', indexval); method? In IE7 this changes my header DIV formatting (it smashes it). The accordion is at the base of the page so when it is activated my header disappears. Can anyone offer me some help with this? Here's what I have.. The the activation i...

Is pure client-side dom manipulation possible using Rails' prototype helper?

I have a div that I want to show or hide depending on whether a hyperlink is clicked. This obviously doesn't require any server-side interaction. But is there a way to do this using Rails' prototype helpers? Or should I simply use JQuery or pure Javascript to do this type of client-side manipulation? ...

Event Bubbling jQuery + Tabs

Hi Everyone, I've just developed a simple page, using the standard jQuery tabs jQuery Tabs Link I've include the jQuery history/remote plugin to allow bookmarking and back navigation. There are some JavaScript elements within the tabs themselves, such as lightbox, which is called on page load. The history/remote plugin seems to be af...

How do you avoid JQuery toggle() on a layout div from causing your layout to move around?

I have a JQuery function that toggles one of the divs in my layout. The problem is that the whole layout moves around on the screen when the div appears or disappears. Is there a way to achieve the same show/hide effect without altering the layout? <script> $(document).ready(function(){ $("button").click(function () { $("#la...

Firefox textarea typing causing screen shaking (firefox2 winXP)

EDIT: Firefox 2 windows XP Steps to reproduce problem: Firefox 2 and visit: http://resopollution.com/rentfox/html/property_setup.html Begin Typing and pressing [enter key] to create new lines After about 10 [enter key] presses you'll notice the screen shaking How this happened This began happening after I installed a plugin for jQ...

Zend Framework - Passing a variable within a controller for an ajax call

Hi out there in Stackland! Here's my problem: I want to use my Zend controller to load an array from a database, and then pass it to javascript. I've decided the best way to do this is to use ajax to ask the controller for it's array, encode it in json, and then pass it down. However, I don't know how to pass the variable I loaded in...

ASP.NET Access current session using jQuery

Is there a way to modify the current Session() variable using jQuery? If it involves deconstructing the ViewState then I'm not really interested. Just curious if there was some easy way to do it. Thanks! ...

jQuery Blur Fires Before href

I am trying to use an Ajax search\suggest box. I use jQuery to handle the textbox losing focus. However, when I click on a link in the suggestion list jQuery fires the blur event and the link is not followed. Here is the jQuery code: $(document).ready(function() { $('#lstxt').click(function() { this.value = ''; }); ...

How does one return data to the original caller function in Javascript?

I have a problem returning data back to the function I want it returned to. Code below: function ioServer(request_data, callback) { $.ajax({ cache: false, data: "request=" + request_data, dataType: "json", error: function(XMLHttpRequest, textStatus, errorThrown){}, success: function(response_d...

JQuery Tooltip Plugin from Jorn

I am thinking someone may have run across this one, but not sure. From a high level, I am trying to roll over a input [type=text] and display a tool tip (with the contained value) using the plugin available at http://bassitance.de. I have to use titles and classes for validation on the specific elements, so I put a blank div to hold ...

Replace selected text with jquery/javascript

I am trying to build a specialized WYSIWYG text editor in the browser, and have a very limited set of functionality, but the biggest part of that is wrapping certain text in span tags. I can find many resources explaining standard stuff (execCommand and whatnot), but have looked and looked and can't find anything to do what I need. Bas...

JavaScript or jQuery string ends with utility function

what is the easiest way to figure out if a string ends with a certain value? ...

How do I use multiple selectors in jQuery?

I am using the following code to apply a hover effect to a set of images within a div called toolbar: $("#toolbar img").hover( function() { this.src = this.src.replace("_off", "_on"); }, function() { this.src = this.src.replace("_on", "_off"); } ); But I also want to apply the same effect to a d...

shortening following jquery expression

Any suggestion on shortening following: $('#btn1').html($('#btn1').html().replace('string 1', 'string 22')); ...

How do I chain or queue custom functions using JQuery?

I have multiple functions the do different animations to different parts of the HTML. I would like to chain or queue these functions so they will run the animations sequentially and not at the same time. I am trying to automate multiple events in sequence to look like a user has been clicking on different buttons or links. I could pro...

How to Get Values from jQuery Select Slider?

I'm using the Filament Group's jQuery Select Slider to produce a form for selecting a range of specific values. How can I get the values of the slider and update <input> field? $(function(){ $('select').selectToUISlider({ labels: 7 }); //fix color fixToolTipColor(); }); I understand that I can get the values throug...

JSF and Jquery - doesn't work

Hi I am trying to get Jquery work in JSF. But i doesn't work. Can somebody help me ? The scripts are in the folder : resources This is my JSP code : I am using netbeans and the <?xml version="1.0" encoding="UTF-8"?> <!-- Document : testpage Created on : 08.07.2009, 01:16:01 Author : reBourne --> <jsp:root version="2.1" xm...

Execute script once for a page

I have added the following script to my asp.net master page $(function() { $("#someDiv").someMethod(900, { chars: /\s/, doit: [" ( <a href='#' onclick='window.location.reload(true);' class='truncate_show'>more</a> . . . )", " ( . . . <a href='#' class='truncate_hide'>less</a> )"] }); ...

Learning JavaScript... Should I skip straight to the good stuff (the frameworks)?

I learnt HTML/CSS a good few years back, then PHP a little later. I've recently become interesting in web development again, just started playing with frameworks like Django and RoR. I'm curious as to how much time/effort I should spend learning straight JS before looking at frameworks. I've been reading through a let of articles called ...