jquery

Problem in loading cities using JSON

I am using Geonames for loading the cities using JSON. Geonames data i imported into my database. I am using MS SQL 2008 Server. I display a dropdown for country select. Once the user select the country. I am loading all the cities into the autocomplete textbox. I am facing a delay in the getJSON method. Also it seems like executing asyn...

How do I automatically update hundreds of images in an HTML page using jquery?

I have an HTML page where I want to refresh a lot of images every 30 seconds after the HTML page has been downloaded. I understand how to do this with Jquery and a single image, but I want to use about 200 custom urls to determine the current image to display for over 200 images. I need to find an efficient way to have jquery call the cu...

jQuery photo carousel (that looks like a real carousel)?

I am on the lookout for a jQuery photo carousel that can display 3 images at a time, and circle through x amount of photos (and when reaching the last, starting with the first photo again). I made a quick mock-up of what i am looking fore - see it here. So there is 3 photos vissible, the middle one beeing the 'main' one and a bit bigge...

Benefits of .click() over .bind('click') in jQuery

Is there any benefit to using .click() over .bind('click') or vice-versa besides the amount of typing you have to do? ...

jQuery .css() behaves differently in FF and IE

When there is no border, why IE returns medium while FF returns 0px on the following query ? .css("border-left-width") I checked this in FF 3.6.3 and IE 6/7. Example here ...

Can't focus fancybox iframe input

So I'm using fancybox to load up a login iframe, and I would like it onComplete to bring focus to the username field. If someone could take a look at this code and let me know what's wrong, that'd be great. Gracias. /* Function to resize the height of the fancybox window */ (function($){ $.fn.resize = function(width, height) { if (!wi...

Replacing text with a link in jQuery

I'm trying to replace a small part of text in a large HTML document with my own element which I create on the fly. The text may be a huge bulk of text, html, images, what-ever, and what I want is to find the first (or all) the position of a certain string, and replace it with an element that I create using $('< span>'). Using simple te...

Use Jquery With and Iframe & Progress Indicator

I know this exists out there, somewhere but I haven't found it in a few hours of searching. I simply have to load a clients external page into an IFRAME, but I want to use jquery ui to present the loading image while it's grabbing the external data. Simple yes, but I've seen pieces of this not the whole thing. ...

Using arrays in Jquery

Here is a code: <input type="button" id="array[1]" value="Value1" /> <input type="button" id="array[2]" value="Value2" /> <input type="button" id="array[3]" value="Value3" /> And I want to do something like that: $('#array').click(function() { id = this.id; $.ajax({ here goes type, url, data and else });...

How can I keep data that a user has entered in my jQuery/Ajax pop-up form?

I have a form on a website I'm working (you can see it here) on that allows my users to give feedback. It's an jQuery/Ajax popup form: $('.contact_us').click(function(){ var boxy_content; boxy_content += "<div style=\"width:300px; height:300px \"><form id=\"feedbacked\">"; boxy_content += "<p>Subject<br /><input type=\"text...

jQuery .load() and sub-pages

Hi, I am not just a newbie with Javascript. I am developing a simple site to get my hands on web programming. The web site is simple and structure is like this: A simple ul/li/css based navigation menu Sub pages are loaded in "div" using jQuery, when ever user click appropriate menu item. Some of the sub-pages are using different jQue...

Sticky Footers that move down when dynamic content gets loaded

I've been using this snippet of jQuery to get a sticky footer: if($(document.body).height() < $(window).height()){ $("#footer").css({ position: "absolute", top: ( $(window).scrollTop() + $(window).height() - $("#footer").height() ) + "px", width: "100%" }); } $(window...

Jquery functions. Should I hold it in one file or is it okay to intersperse it?

So, I have a lot of php files where I use jquery functions. Do I need to create a seperate .js file for all jquery functions or I can put it together with php files or it actually doesn't matter at all? ...

How to put buttons in a html page in a jQuery dialog

eHello everyone,the following is my code to display a jquery dialog window with a closing button "OK": <script type="text/javascript"> $(function(){ $("#dialog").dialog({ autoOpen:false, bgiframe:true, buttons: { "OK": function() { $(this).dialog("close"); } }, width:500, height: 350, ...

how to get dynamically created elements width and apply style to that?

Hi, I am creating an li element dynamically like this: $(data).find('slide').each(function(numSlide){ var slideLink = $(this).attr('link'); var slideimage = $(this).children('slideimage').text(); var slidedesc = $(this).children('slidedesc').text(); $('.slider ul').append('<li><a href="'+slideLink+'"><img src="'+root+"images/to...

How to pass some data to JQuery AJAX in CAKEPHP

Hi all, I am learning how to use JQuery to help check data availability. To start with it, I wrote a few lines of codes using cakePHP. I have written a function in a Controller for checking data input, and the URL is like this: http://www.mywebsite.com/controllers/action/avariable I was trying to pass the value in a Input TextBox fiel...

jQuery plugin for Facebook "Like" Button

On lots of sites now, you can see a Facebook "Like" Button. - When depressed, it changes background color. - When mouse-overed, it allows you to write some additional text I love this interface - lightweight action, but allow for expression of more data if the user wants to. Anyone has written a similar plugin? UPDATE: See: http:/...

Using jQuery to auto-populate a form field from another form field

Has anyone used jquery to take data from one form field and put it into another? I'm trying to create a form that when one text input is filled out a second is auto-populated with the first letter of the word that is in the first text input. I'm thinking I can limit the second text input to one character to help get the desired result, b...

JqGrid Add custom button to Row

Hi there, I am trying to add a custom button to a JqGrid that implements a 'Check Out' process. Basically, every row has a 'Check Out' button that if clicked should be able to send a post back to the server and update a shopping cart and then change the button text to 'Undo Check Out'. So far I have: colNames: ['Id', ... , 'Action' ], ...

Add console.profile statements to JavaScript/jQuery code on the fly.

Hi folks, We have a thick client app using jQuery heavily and want to profile the performance of the code using firebug's console.profile API. The problem is, I don't want to change the code to write the profile statements. Take this example: var search=function(){ this.init=function(){ console.log('init'); } this.a...