javascript

Best JavaScript Calendar control

Is their any JavaScript Calendar control which can handle the different Date Time Formats easily? ...

Encoding user input for emails

On a website if I have a form where the user can input some text and then a page which displays what the user has entered, I know to html encode the values the user has entered to prevent scripting attacks. If the form was sending html emails I presume I would do the same but is there any special cases for emails and will email clients r...

Executing JavaScript on page load selectively

Hi, Mending a bug in our SAP BW web application, I need to call two javascript functions from the web framework library upon page load. The problem is that each of these functions reloads the page as a side-effect. In addition, I don't have access to modify these functions. Any great ideas on how to execute a piece of code on "real" pa...

The difference between the two functions

What's the difference between: function sum(x, y) { return x+y; } // and var sum = function (x, y) { return x+y; } Why is one used over the other? ...

Should I learn/become proficient in Javascript?

I am a .NET webdev using ASP.NET, C# etc... I "learned" javascript in college 5+ years ago and can do basic jobs with it. But I wonder if it is useful to become proficient in it. Why should I learn Javascript? Is it more advantageous then learning JQuery or a different library? ...

What is the best way to pack javascript without getting perfomance flaws?

I am searching for a way to compress javascript for the iphone but don't want to use a lot of cpu time on the small an rather slow device. ...

How expensive are JS function calls (compared to allocating memory for a variable)?

Given some JS code like that one here: for (var i = 0; i < document.getElementsByName('scale_select').length; i++) { document.getElementsByName('scale_select')[i].onclick = vSetScale; } Would the code be faster if we put the result of getElementsByName into a variable before the loop and then use the variable after that? I am...

"No symbols loaded for the current document" Visual Studio 2008 Javascript Debugging

I'm working on a .net 3.5 website, with 3 projects under one solution. I'm using jquery in this project. I'd like to use the visual studio javascript debugger to step through my Javascript. If I set a breakpoint in any of the .js files I get a warning that says "The breakpoint will not currently be hit. No symbols have been loaded for th...

Why is isNaN(null) == false in JS?

This code in JS gives me a popup saying "i think null is a number", which I find slightly disturbing. What am I missing? if (isNaN(null)) { alert("null is not a number"); } else { alert("i think null is a number"); } I'm using Firefox 3. Is that a browser bug? Other tests: null == NaN; // false isNaN("text"); // true NaN == "tex...

Process Kill in Jscript

I'm writing a script for Caseware, the accounting software my Company uses, and I need to kill a process that hangs and messes up the compression of files on the server. The problem is it needs to be written in jscript and I havn't had a lot of experience with it. I've been looking around for code examples people use to kill process but...

Are there any jEdit syntax highlighting modes for Objective-J

I have found some in the Cappuccino website (vim, textmate and SubEthaEdit), but not for jEdit, and unfortunately I'm just starting on Objective-J so can't make my own. If anyone has got one of them lying around it would be greatly appreciated. ...

Syntax to declare JS scripts

Hi! I'm not sure about what's the difference between opening a JS script with <SCRIPT language='JavaScript'> or with: <SCRIPT type="text/JavaScript"> Should JavaScript always be quoted (either with " " or with ' ') or that's not really important? Thank you for any clarification on this topic! ...

Flash: Coming back from another tab in browser, can flash listen to return to tab event of some sort ?

I got this flash application where you can click a link while watching a video. It will open a new tab and pause the video. Now when you come back to the flash application it would be nice if the video would start playing again. Is there a way, an event or so to do this ? ...

How do you handle browser specific .js and .css

This is not a new topic, but I am curious how everyone is handling either .js or .css that is browser specific. Do you have .js functions that have if/else conditions in them or do you have separate files for each browser? Is this really an issue these days with the current versions of each of the popular browsers? ...

Dragging HTML cells over the table using Javascript

Folks, I need a solution that allows drag-and-drop cell over the table. The cells can be of different colspans, so when the cell is dropped into the middle of another cell, which is bigger, the following steps should be performed: Another td element is created, which is equal in width to the draggable element. Cells on left and righ...

What is the best back button jQuery plugin?

I have found two plugins that enable the browser's back button to work across ajax interactions, but I can't determine which is better and why. The two plugins are history_remote and the history. The history plug in is simpler and seems to provide all the functionality I need, but I'm not sure I understand enough about them to make a...

Maximum Number of characters with FCKeditor

Have you determined a maximum number of characters allowed in FCKEditor? I seem to have hit a wall. It will display the text to be edited, but changes don't get posted back to the server - only the original text gets posted back to the server. I am assuming that the changed text is not copied back to the hidden input field. This prob...

Firebug 1.2 document.cookie inconsistency with Web Developer

I have a URI here in which a simple document.cookie query through the console is resulting in three cookies being displayed. I verified this with trivial code such as the following as well: var cookies = document.cookie.split(';'); console.log(cookies.length); The variable cookies does indeed come out to the number 3. Web Developer o...

Javascript to extract author/date from SVN keyword substitution

SVN keyword substition gives is not pretty. E.g., Last updated: $Date$ by $Author$ yields Last updated: $Date: 2008-09-22 14:38:43 -0400 (Mon, 22 Sep 2008) $ by $Author: cconway $" Does anybody have a Javascript snippet that prettifies things and outputs some HTML? The result should be more like: Last update: 22 Sep 2...

What Event to Trigger Javascript Form Field Validation and Formatting?

Let me first say, we validate every field on the server side, so this a question about client-side usability. What is the conventional wisdom on exactly when to validate and format html form input fields using javascript? As an example, we have a phone number field. We allow numbers, spaces, parentheses, and hyphens. We want the fiel...