Hi, I have the following bit of code to create an automatically resized text input:
// setup quick jump input
$("#goto").keydown(function(e){
var size = $(this).val().length;
// sanity
if ( size < 1 ) {
size = 1;
}
$(this).attr("size",size);
// if enter then GOTO->
if ( e.keyCode == 13 ) {
window.location.href =...
When doing validation in JavaScript, how do I keep validation methods that need to handle a bunch of contingencies from becoming unruly?
For example, I have a form with a field that has validation that checks:
is the new value a number?
Is the value in another field on the
form > 0 when the current field > 0
Is another field on the fo...
I understand that with javascript you can select the contents of a textbox with the following code (in jQuery):
$("#txt1").select();
Is there a way to do the opposite? To deselect the content of a textbox? I have the focus event of a series of textboxes set to select the contents within them. There are times now that I want to focu...
I have the following script in my homepage
$(function () { // same as $(document).ready(function () { })
// assuming we have the open class set on the H2 when the HTML is delivered
$('li.drawer h2:not(.open)').next().hide();
$('h2.drawer-handle').click(function () {
// find the open drawer, remove the class, move to the UL fo...
I've heard that it's no good idea to make elements global in JS. I didn't understand why. Is it something IE can't handle?
For example:
div = getElementById('topbar');
...
Does DW cs3 have a javascript debugger?
The only info on anything close to is says I need to click on the
'preview/debug in browser' button which does open the page, but no
debugging ever happens when the page has an error. I also see no way
to set break points or walk through the code.
Thanks in advance.
Update 2
I thought I'd...
I have this code but since I use "" the a.innerheight does not get replaced by its value. Is it possible to make this dynamic?
a.style.webkitTransform = "translate(0,a.innerHeight)"
...
Does Virtual Earth have any kind of built-in support for interactive polygon editing? Something like Google Maps' polygon.enableEditing() would be ideal.
...
I have a very simple page built to display a map and overlay a line based on
points in a GeoRSS XML file. Here is the publicly accessible file.
http://68.178.230.189/georssimport.html
Firefox is loading in about 5 secs, which is expected because there are a lot of
points to map, but IE (6 & 7) is taking upwards of 45 secs to a minute. W...
Firebug is reporting a "return not in function" error with no location (well, line 1 of nothing). How can I track down the source of this error?
return not in function
[Break on this error] return(0)
javascript:return... (line 1)
I'm running FireBug 1.05 on FF 2.0.0.20 on Ubuntu.
I found a solution that works (for this configuratio...
Hi.
I am playing around with Google Maps for the first time. And I am struggling to extact some information about the location where the marker is.
I have set up an example for you to see. The problem happens when I drag the A-node, the getGeocode() returns undefined?
I need to extract zip-code, city, and address from the node when I ...
I want to use jQuery to dynamically expand my markup so that my divs show up as nice rounded boxes.
For example if my DOM has a series of div objects with unique ids like:
<div id="queuediv0" class="isequeue" > </div>
Which can be selected using:
$(“.isequeue”)
I want to replace/wrap those divs so that the end result looks like:
...
I have a <input> with an onclick event which checks for the Enter key. The called function may do a window.location redirect.
However, when I press the Enter key, it apparently fires off the page validation. So I see the validation messages for a split second.
How can I tell the page not to fire any of the validation events when the ...
I don't understand how closure is more powerful than class. It looks like I can achieve the same behavior of closure using class. Any help would be appreciated
...
Hello!
I'm trying to create a managedStore to cache all the js, img, swf and css from a web app I'm developing.
Here is the code:
$(document).ready(function() {
var manifestName = 'cache_manifest.json';
var storeName = 'cache';
var localServer;
var localStore;
if (window.google && google.gears) {
localReque...
Hi:
I have a C# webbrowser that holds an html page that has several iframes. Each iframe holds an arbitrary html file, often with images. The img tags often don't have any width or height attributes (ie, it's often just <img src="someimage.jpg">).
I've read about how to size iframes based on their content, and have gotten it to work ...
The canvas element unfortunately doesn't handle text well. There are a bunch of approaches (see e.g. http://canvaspaint.org/blog/2006/12/rendering-text/ ), but they mostly seem like hacks. What can I do that is cross-platform and gives me the most flexibility to make my fonts like how I want?
...
FF2 (at least) doesn't mark as link as :visited if it triggers the onclick handler without following the href. I'm using onclick to fetch data from a server and modify the page and the link styling seems appropriate here. But the link is not marked as visited.
Is there a cross-browser way to mark the link as visited? Failing that, is...
I would like to use javascript to style an element to look like a :visited link, without defining my own styles for visited links. How can I access the browser's default style for visited links, so that I can define a matching style that I can apply to an element (e.g. by applying a class name)?
...
Browsers provide load events for <script> and <img> tags. Is there a way to detect whether a request to a element has completed?
Specifically, I'm wishing to detect when a <link>'d stylesheet has been loaded.
Unfortunately, I think using a sentinel style and detecting load from a computedStyle isn't workable in my situation.
...