javascript

Autocomplete jQuery Plugin : Value of selected array index

How do I get the value of the index position in the array, whose element the user had chosen using the autocomplete? For e.g. if I enter the array having two elements as the input for the autocomplete plugin: var arr = []; arr[0] = "John"; arr[1] = "Paul"; Then, say user selects "Paul", how do I get the value of the selected index "1...

Images don't load in IE

Demo: http://www.simpsoncrazy.com/characters/poster2 (Using Map Hilight plugin: http://plugins.jquery.com/project/maphilight) When you click a quadrant of the image, it should zoom in on that image, however in IE8 (regular and compat mode) the "zoomed" images never load. Also on the top-left segment the right arrow appears on the left. ...

how lightboxes for pics works? they use iframes? how they download pics?

how lightboxes for pics works? they use iframes? how they download pics? ...

Putting Variable in Jquery Selector

I just want to dynamically put in the index, which is calculating correctly, so I know the value of my variable isn't a problem, but it's not working: My variable 'parentIndex' stores the index of the span I want to be selecting below. I have tested this variable and it returns the correct value. $(".DropDownMenu span:eq("+parentIndex...

:empty pseudo selector with jQuery on a form element?

Is there a way I can use a jQuery pseudo selector like :empty or :not(:checked) on an input/textarea/select element, or any other way I can return an object that is empty? ...

jQuery Filter Two Arguments

This code validates a set of form elements, var objects = $(".validated").filter(function (){ return $(this).val() == ''; }); Is there i could also filter for a length of >10, for example? Thanks! ...

How to find out the dimension of the lightbox?

About the lightboxes. The box adjusts its dimension to match the picture. Question is how do the box find out the size of the picture? ...

Does a javascript if statement with multiple conditions test all of them?

In javascript, when using an if statement with multiple conditions to test for, does javascript test them all regardless, or will it bail before testing them all if it's already false? For example: a = 1 b = 2 c = 1 if (a==1 && b==1 && c==1) Will javascript test for all 3 of those conditions or, after seeing that b does not equ...

jQuery fadeIn fadeOut with click

I'm trying to make a div fadeIn when another div is clicked and fadeOut again when another div is clicked (which would be the close button) but my code doesn't work, did I forget something? Here's the CSS: body{ margin: 0; padding: 0; text-align: center; background-color:#f0f2df; } #container{ border: solid 1px #f0...

Open a new browser window from a Python script in Google App Engine

A Python script at Google App Engine fetches data into a HTML page. What is the best way to open a new browser window from the script or HTML page? JavaScript doesn't work. ...

create json string on client side

Hi, I am trying to create the JSON string / object that is equivalent to the following data on the server side. can somebody help? Public Shared Function GetData() As List(Of Employee) Dim list As New List(Of Employee)() Dim newEmployee As New Employee() newEmployee.EmployeeID = "1" newEmployee.FirstName = "Sridhar" ...

jQuery Filter Help

What is wrong with this code... var objects = $(".validated").filter(function(){ return $(this).attr("name") == 'name'; }).filter(function (){ return $(this).val() == ''; }); Its really bugging me :( ...

How to remove the browser cache?

I have one image website where users can vote images. IMAGES ARE RANDOMLY GENERATED ON FIRST PAGE! Once they vote they're redirected using window.location to the image details page. If they click back they will see the same image...from the browser cache..and they can vote it unlimited times.... How to I remove the cache? I want the fir...

jQuery and 2 fadeIn in one click

Is this the right way to make 2 divs fadeIn together? (contact_close should be infront of contact_box to serve as a close button for contact_box. EDIT: fixed some divnames. Javascript $(document).ready(function(){ $(".button_contact").click(function() { $("#contact_box").fadeIn("slow"); $(".contact_close").fadeIn("slow"); });...

Javascript change class of an element

I have ul list and I need to change the class of one of <li> tags with javascript: <ul> <li>...</li> <li class="something"> <- need to change this class to "myclass" (javascript goes here)</li> <li>..</li> </ul> Thank you. ...

"Stop running this script" - IE for large AJAX requests

I'm using jQuery.getJSON(...) to make a call/process response for a slightly large data set. The response time being a couple of seconds is expected(there's an animated loading graphic to placate the user). All being said, the loading graphic, response, process, etc are working fine in all browsers. In Internet Explorer(6/7/8), however,...

Looking for free, web-based map API recommendations for a future webapp

I'm doing some research for a Maps project I'll be starting soon, and I'm trying to evaluate which of the Map APIs will be best-suited to this project. I've worked pretty extensively with the Google Maps Javascript API, but no others. My basic requirements are, in no particular order: Free: as in beer, not necessarily as in speech. Web...

How to make users able to upload images in a form ?

I have a classifieds website where users must fill in a form in order to put a ad. The form consists of name, password, category, specifications etc etc. Now, I need to add a image upload function into this form, which must have the following: 1- Upload up to 5 images. 2- A 'remove image link' beneath each image if the user wants anoth...

How can I modify a page after a file is finished downloading to the browser?

Hello! I've got a simple C# ASP.NET app that generates an Excel file and sends it to the browser using the Response.WriteFile() function. I would like to disable the submit button once it has been clicked and display a message on the screen to wait a few minutes, since some of the files can take a while to generate. This works great, ...

Disabling middle click scrolling with javascript

Background: I am creating a table reminiscent of whenisgood.net, in that it has click-n-drag toggling for table elements. I want to call different types of toggling code when the left, middle, and right mouse buttons activate a mousedown event. By using JQuery, I'm off to a good start. $(".togglable").bind("contextmenu", function() {re...