javascript

How do I populate one listbox from another listbox using JavaScript?

Can anyone tell me how to populate one listbox from another listbox item using JavaScript or ASP.NET 2.0? Duplicate How would I move one list box items to another listbox items in JavaScript? For ex--My 1st listbox is Region then accourding to region selection the second listbox country will be display and accourding to countr...

JavaScript Collection of one-line Useful Functions

This is a question to put as many interesting and useful JavaScript functions written in one line as we can. I made this question because I'm curious how many people around like the art of one-Line programming in JavaScript, and I want to see their progress in action. Put variations of each code inside comments. ...

making a constant heading - css problem

I have an AJAX application which has used CSS divs to create panels on the screen, which are loaded separately and in succession, depending on what was loaded before it. The bottom "panel" is a table showing a list or records from a database. At the top of the database is the name of the table, and I would like a way to have it be always...

Getting custom tooltips with JQuery

Hello, I'm looking for a JQuery code sample or library for displaying tooltips when the cursor hovers over an element. Specifically, what I want to do is display my own <div> element on hover, not an automatically-constructed or loaded-from-the-host-element tooltip. I've looked at a couple JQuery tooltip plugins and they all seem to be ...

How do you compare a value from jQuery with a fixed number?

How do you compare a value from jQuery with a fixed number? I thought this might work but it doesn't: if (parseInt($("#days").value) > 7) { alert("more than one week"); } ...

How do I print an IFrame from javascript in Safari/Chrome

Hi, Can someone please help me out with printing the contents of an IFrame via a javascript call in Safari/Chrome. This works in firefox: $('#' + id)[0].focus(); $('#' + id)[0].contentWindow.print(); this works in IE: window.frames[id].focus(); window.frames[id].print(); But I can't get anything to work in Safari/Chrome. Thanks ...

Jquery Live Validation

Hello Everyone, After having a search around I could not find exactly what I want, I am looking to validate a form client side using the Jquery library and some form of validation plugin. I was hoping that some one could advise me on whether there are any validation plugins out there that do not use generic error messages, as my form ...

How can I get the full backtrace in spidermonkey (JSAPI) from my reportError function

I'm embedding javascript in my app using spidermonkey and I have a function called reportError that receives a JSErrorReport. It seems simple to grab the current line of the error, but is it possible to get the entire call path to display a full backtrace? ...

Javascript local variable technique

I have a simple question related to one-line programming. First an example: function test(a) { var b=a.toString(); return b.replace("a","b"); } It's very simple (this function is, of course, useless), but the question here is little more complicated: What if I was to do this in one line? I have my thoughts, but tell me does this...

VIM + JSLint?

I spend my days in vim, currently writing a lot of JavaScript. I've been trying to find a way to integrate JSLint or something similar into vim to improve my coding. Has anyone managed to do something like this? Edit: tried this: Javascript Syntax Checking From Vim, unfortunately the output is very crude. ...

Javascript to check whether a checkbox is being checked or unchecked

I have a javascript routine that is performing actions on a group of checkboxes, but the final action I want to set the clicked checkbox to checked or unchecked based on if the user was checking the box or unchecking. Unfortunately, every time I check for whether it is being checked or unchecked, it returns "on" indicating the user is a...

What external resources are loaded when window.onload event is fired and what is the loading order of the resources?

Since a single web page may contain lots of external resource: external javascript, external css, images, applets, flash, etc., usually my conventional wisdom tells me that the window.onload event is fired when all the linked resources are finished downloading(though the external resources are usually downloaded in multiple threads or pr...

Does IE & Firefox have a div width limit?

In short, I'm trying to make a weather scroller that will display the weather horizontally for about 50 cities. The issue I'm having is that both IE and FF are making 2-3 lines worth of cities while Chrome keeps it in a nice horizontal line. So Chrome has 1 line scrolling with the weather and IE+FF have 2-3. I've pasted my current code ...

Can an asterisk in the text cause a getJSON request to not work?

This is really strange but this code is working fine unless the value entered by the user includes an asterik (*) or other characters like $ or #. The #ticketNumber.Val() is the suspected problem. Some of our id's have an * in them. Any help would be appreciated. function buttonClicks() { var action = '/ServiceCall/IsAServiceCall...

ajax and accessibility

1) How important is it for the site to be accessible without javascript? I'm using a lot of ajax. I converted most of the site to be accessible without js, but the effort involved left me wondering if it was worth it. 2) What are the sort of scenarios (that occur fairly often) in which javascript might be turned off? (apart from people ...

jquery question concerning selectors and $(this)

Ok this is a general question about how to solve this issue, not to find some work around for the example given. Lets say I have a $(this) object and it is a select, if I want to select the selected option and I had an id I could just bust a $('#id option:selected') game over. but with a this I can't go $(this+' option:selected') or ...

How to show Google Maps tile overlays of Google Earth's Old-world maps (or a blank / physical world map)?

I am trying to build a Google Maps-driven web application that can display a map of the whole world in one or all of the following configurations: A continent-outline map, only differentiating between land and water (like this, but without the country borders/names, and without showing any additional detail as you zoom in) A physical g...

Vertical Wrapping in HTML

I'm looking for a good way to do a vertical wrap. My goal is to fit a list of checkboxes into a div. I have the checkboxes sorted alphabetically, and I want the list to flow from the top of the div to the bottom and then begin again in a new column when they reach the bottom. Right now, I can do this by breaking the list into chunks o...

Do I have to use JavaScript?

When does it become unavoidable and when would you want to choose JavaScript over server side when you have a choice? ...

onclick event not working after ASP.net AJAX save.

Hi, I have an gridview that I am adding onclick events to a checkbox column via: cb.InputAttributes.Add("onclick", "checkClick()"); everything works fine, but when the user clicks the save button on the form, (which is within the updatepanel), suddenly the onclick event of the checkboxes stops firing! Is this a problem with the A...