javascript

How do you allow multiple file uploads on an internal windows-authentication intranet?

I have a couple of solutions, but none of them work perfectly. Platform ASP.NET / VB.NET / .NET 2.0 IIS 6 IE6 (primarily), with some IE7; Firefox not necessary, but useful Allowed 3rd Party Options Flash ActiveX (would like to avoid) Java (would like to avoid) Current Attempts Gmail Style: You can use javascript to add new Uplo...

Preventing accidental double clicking on a button

I have a few controls that inherit from ASP.NET buttons and use 'onserverclick'. If the user clicks twice, the button fires two server side events. How can I prevent this? I tried setting "this.disabled='true'" after the click (in the 'onclick' attribute) via javascript, but that blocks the first postback as well. ...

Can I prevent user pasting Javascript into Design Mode IFrame?

Howdy, I'm building a webapp that contains an IFrame in design mode so my user's can "tart" their content up and paste in content to be displayed on their page. Like the WYSIWYG editor on most blog engines or forums. I'm trying to think of all potential security holes I need to plug, one of which is a user pasting in Javascript: <scr...

__doPostBack not rendering on postback

I'm having a strange problem. I have to use GetPostBackEventRefence to force a Postback, but it works the first time, after the first postback, the .NET function is not rendered... any ideas? This is what I'm missing after the postback: <script language="javascript" type="text/javascript"> <!-- function __doPostBack(eventTarget, event...

How do you capture mouse events in FF, over Shockwave Object

How do you capture the mouse events, move and click over top of a Shockwave Director Object (not flash) in Firefox, via JavaScript. The code works in IE but not in FF. The script works on the document body of both IE and Moz, but mouse events do not fire when mouse is over a shockwave director object embed. Update: function displa...

Google Finance - Get Quotes search box - Column Alignment

How does Google manage to properly align the second column (i.e. the ticker name) in the "Get Quotes" search box suggestion dropdown in http://finance.google.com? e.g. if you enter "iii" - the second column is perfectly aligned. It does not use a fixed-width font - so just adding the correct numbers of spaces to the "ticker" will not w...

How do you do string comparison in JavaScript?

I have a list of data objects to sort. I want to do something like list.sort(function(item1, item2){ return item1.attr - item2.attr; }) to sort it based on a string attribute of the object. But I found that the minus (-) operator does not work for strings in JavaScript. So how do you do string comparison? ...

Are Javascript strings immutable, do I need a "string builder" in js?

does javascript use immutable or mutable strings? ...

Access to restricted URI denied code: 1012

How do you get around this Ajax cross site scripting problem on FireFox 3? ...

Pass Silverlight type to Microsoft AJAX and pass parameter validation

I'm working on a Silverlight application where I want to take advantage of the Microsoft ASP.NET AJAX Client library. I'm calling the library using the HTML Bridge that is part of Silverlight 2. Silverlight got great support for passing types between JavaScript and Managed Code, but now I've bumped against a problem. Microsoft ASP.NET A...

How to show a spinner while loading an image via JavaScript

I'm currently working on a web application which has a page which displays a single chart (a .png image). On another part of this page there are a set of links which, when clicked, the entire page reloads and looks exactly the same as before except for the chart in the middle of the page. What I want to do is when a link is clicked on ...

JavaScript culture sensitive currency formatting

How can i format currency related data in a manner that is culture aware in JavaScript? ...

How do I build a loop in JavaScript?

How can I build a loop in JavaScript? ...

How can I highlight a table row using Prototype?

How can I use the Prototype library and create unobtrusive javascript to inject the onmouseover and onmouseout events to each row, rather than putting the javascript in each table row tag? An answer utilizing the Prototype library (instead of mootools, jQuery, etc) would be most helpful. ...

How to detect (using .ASPX) if Javascript is enabled on browser

I'm thinking this might be a quick and easy way to lower the form spam on our site just a little bit. The idea being that (I have read) spammers aren't running with javascript enabled. (Or at least they are accessing your website without running javascript. I.e., they aren't browsing up to it in IE or FF. I can use .asp or .aspx. ...

Simple & basic form spam reduction: checking for Javascript?

I'm trying to reduce the form spam on our website. (It's actually pretty recent). I seem to remember reading somewhere that the spammers aren't executing the Javascript on the site. Is that true? And if so, then could you simply check for javascript being disabled and then figure it's likely that it's spam? ...

Best Practice: Legitimate Cross-Site Scripting

While cross-site scripting is generally regarded as negative, I've run into several situations where it's necessary. I was recently working within the confines of a very limiting content management system. I needed to include database code within the page, but the hosting server didn't have anything usable available. I set up a couple...

How do I add a div and pick it up later

I think this is specific to IE 6.0 but... In javascript I add a div to the dom...I assign an ID attribute. When I later try to pick up the Div by the ID all I get is null??? Any suggestions? Example: var newDiv = document.createElement("DIV"); newDiv.setAttribute("ID", "obj_1000"); document.appendChild(newDiv); alert("Added:" + newD...

CSS overflow table row positioning

I have table inside a div tab. The table has 40 rows in it and the div's height is set to show 10 rows of that table. CSS's overflow:auto lets me scroll through the 40 rows. All is well there. How can I, with JavaScript cause the table to programatically position to a given row (ie, programmatically scroll the table up or down by row)?...

Open Source Actionscript 3 or Javascript date utility classes?

I was wondering if anyone could point to an Open Source date utility class that is fairly robust. I find myself rolling my own when I want to do a lot of things I take for granted in C# and Java. For instance I did find a decent example of a DateDiff() function that I tore apart and another DatePart() function. Another examples would be ...