javascript

Why doesn't this search box select all text on click?

You can see the search box in question at: http://www.trailbehind.com. If the user tries to search twice, they have to press backspace a bunch to clear the text, but I'd like to select all text on double click, which inputs should do by default. Why doesn't mind? When the users first clicks, I clear the input as follows: input.onclick...

How to Interact with a program using WSH -Jscript

I am trying to click a button on an application in the systray using WSH. Is this possible? Could somebody provide an example written in Jscript please? THANKS ...

Draw a box on an image, javascript only?

What i want to do is have a user upload his image. When its complete it will display the image on the same page w/o refreshing. Here is the part i need to figure out, how do i have the user select a box in the image? so i can crop it when the user is done? (using ImageMagick). If possible i would like a border for the user to stretch to...

How to open only external links in a new browser window via JavaScript?

Hi guys, I know this is a common requirement and there are lots of answers out in the wild. I would really appreciate if someone can provide a correct script which opens only external links from an HTML file in a new window. ...

Which is faster for finding element in javascript array?

Hi, I'm a noob and wrote a whole program without knowing the easy way to find an element in an array... my_array.indexOf("find this value"); Is indexOf a lot better than storing how many elements are in an array, and looping through the array until you find the element you want? I could have simplified my code alot. I tried to make ...

Alternatives to JavaScript

At the moment, the only fully supported language, and the de-facto standard for DOM tree manipulation in the browser is JavaScript. I just started playing with this language, so I don't know much of it, but after reading some stuff around, looks like it has deep design issues that make it a minefield of bugs and security holes for the no...

Exploring Implements/Extends in MooTools

I'm working on some effects and things to get a handle on Classes/Implements/Extends. The examples here are for the base classes (MooSlidesFx, MooSlidesFx.Elements) from which to create many effects with a project I'm working on, and two child class (MooSlidesFx.Fade, MooSlidesEffects.Elements.Fade) that actually do something. http://pa...

jQuery iframe scroll event (IE)

Can't listen to the scroll event in Internet Explorer 7. I've tried: $("#myIframe").scroll(function() { alert('hi'); }) Works for FF: $($("#myIframe").contents().get(0)).scroll(function() { alert('hi'); }) Getting keypresses work: $($("#myIframe").contents().get(0)).keydown(function() { alert('hi'); }) ...

JW FLV Player Javascript event

When a user triggers a Javascript action, I want the JW FLV to seek back 5 seconds from the current location. I know how to send events using player.sendEvent('SEEK',seconds). But I dont know how many seconds to pass as JS does not know the current location. Can someone please help? http://developer.longtailvideo.com/trac/wiki/FlashEvent...

How can i debug this ajax script for IE?

I have and an AJAX script in a page that works just fine with no bugs in firefoex, but IE6 loads the page with an ugly error icon on the status bar. What is the best way i can go about fixing/debugging this? Here is the error report: I have checked line 323 many times Here is the function: function checkAvailability(){ var card...

Customizing a google map that is embedded with an iframe

So I have been looking at Google Maps and they have the feature of "making" your own map and adding in markers and things of that nature through their own interface. The way they have you embedding it on your web site is through the use of an iframe. I have been reading the documentation for Google Maps and the examples shown are when ...

how to translate javascript getTime() value to C# DateTime

I think my brain has just quit on me due to the late hour. Can anyone tell me the best way to translate a javascript getTime() value to a C# DateTime value, I have an ajax component which sends the JS time value as a parameter to ASP.NET mvc controller which will then return some Json objects. Thanks for your help. I do know that the ...

How can I use jscript assertion to filter exception types in Elmah 1.1 RC ?

The first binding against 404 works so I got the ErrorFilterModule set up properly, but the jscript section does not seems to work at all. HttpRequestValidationException is still being send in the report mail. <errorFilter> <test> <equal binding="HttpStatusCode" value="404" type="Int32" /> <jscript> <![CDATA[ ...

Is there a jQuery autogrow plugin for text fields?

I have a found various plugins for autogrowing a textarea, but not input text fields. Does anybody know if any exist? ...

javascript, html and browsing, is there an easy solution?

Straight to the point: I would like to parse the source/DOM of a html page. However i cannot because there is missing information which requires javascript and ajax. I am using C# and .NET. There is a site that uses ajax to browse pages. Theres two sections i am interested in, the wiki and media section. If i have the link to the media ...

AJAX Autosave

What's the best javascript library, or plugin or extension to a library, that has implemented autosaving functionality? The specific need is to be able to 'save' a data grid. Think gmail and Google Documents' autosave. I don't want to reinvent the wheel if its already been invented. I'm looking for an existing implementation of the mag...

Javascript source files on JBoss have the wrong content-type/mime type?

I am writing a JSP application and am deploying it to JBoss 5.0. When I attempt to retrieve my CSS or Javascript files, JBoss returns the wrong Content-type for the file, so Firefox refuses to execute code supplied in them. Here is my web.xml file: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLS...

XMLHttpRequest.open, does it work on remote websites?

I'm a bit confused about this. Does XMLHttpRequest work on a remote URL or does it have to be a local file? There seems to be mixed information on the net. According to w3.org: The XMLHttpRequest object can be used by scripts to programmatically connect to their originating server via HTTP. But I've seen it used to access non-local...

What is the event to catch form submission in Javascript?

A couple of questions here: I was wondering what event do I use to execute some javascript on form submission (to do some validation)? Once I have done my validation, how do I then submit the form in javascript ? Cheers... ...

Newbie: JavaScript stops executing after I set a breakpoint

In one HTML page I have a JavaScript function checkUpdates() that hits the server. I make this function run every 5 seconds with this line: window.setInterval("checkUpdates()", 5 * 1000); In Firebug, I put a breakpoint inside the checkUpdates() function. However, after the code execution stops at this breakpoint, pressing "continue" s...