javascript

Javascript drawing library?

Any suggestion for a JS interactive drawing library? Just need to draw lines, polygons, texts of different colors. IE/Firefox/Opera/Safari compatible. ...

How do I get flash to reload the parent HTML page it is embedded in?

I have a flash app (SWF) running Flash 8 embedded in an HTML page. How do I get flash to reload the parent HTML page it is embedded in? I've tried using ExternalInterface to call a JS function to reload the page but that doesn't seem to work... ...

Are iframes a terrible idea?

I'm building a widget, and I've been using iframes to present content within it. At some point, I might start serving third party HTML and JS, so I thought iframes would be a good idea. It does make the widget javascript a little more complicated, and I'm concerned that this might not be the best implementation. Do you have any advice...

'AjaxControlToolkit' is undefined Error

I am using the AjaxControlToolkit in VS2005, and it works fine. I do have some issues though, when I go to some pages I have, then click back, I get this javascript error: 'AjaxControlToolkit' is undefined I have searched MSDN forums, and google, and tried many of the solutions, but none have worked. I have tried, EnablePartialRenderin...

How do I escape a string inside javascript inside an onClick handler?

Maybe I'm just thinking about this too hard, but I'm having a problem figuring out what escaping to use on a string in some javascript inside a link's onClick handler. Example: <a href="#" onclick="SelectSurveyItem('<%itemid%>', '<%itemname%>'); return false;">Select</a> The <%itemid%> and <%itemname%> are where template substitution...

Debounce clicks when submitting a web form

A poorly-written back-end system we interface with is having trouble with handling the load we're producing. While they fix their load problems, we're trying to reduce any additional load we're generating, one of which is that the back-end system continues to try and service a form submission even if another submission has come from the ...

Why does Javascript getYear() return 108?

Why does this javascript return 108 instead of 2008? it gets the day and month correct but not the year? myDate = new Date(); year = myDate.getYear(); year = 108? ...

What Cross-Browser Javascript Libraries Are Out There?

I'm gearing up to do some AJAX style client side Javascript in the near future and I've heard rave reviews of JQuery when it comes to this realm. What I'm wondering is: What are all the cross browser Javascript libraries out there? If you've used something, please share your experiences. And do your best to avoid bringing religion ...

Scriptaculous not working with the latest Prototype.

This is a really weird problem that I have been having. When I download Scriptaculous from the official web site, script.aculo.us, bundled in the ZIP is prototype.js version 1.6.0.1. This works perfectly fine, I can follow along the wiki examples and begin learning. However, when I upgrade to prototype 1.6.0.2 (the latest version) from p...

Is anyone familiar with Jaxer? I'm looking for pros and cons.

I realize that this question has been asked before, but it has been a month with no decent responses... I'm looking at Aptana's Jaxer and I find the concept to be very exciting. Here is a quick overview for those who are not familiar with it: Jaxer is, in their words, "the world's first true AJAX server". It is based on the Mozilla...

How can I create a Netflix-style iframe overlay without a huge javascript library?

I'm trying to use a link to open an overlay instead of in a separate popup window. This overlay should consist of a semi-transparent div layer that blocks the whole screen from being clicked on. I also aim to disable scrolling at this point. Not matter where you are on the main page, when the link is clicked, the overlay should be in the...

What JavaScript Repository should I use?

Many languages have standard repositories where people donate useful libraries that they want others to have access to. For instance Perl has CPAN, PHP has PEAR, Ruby has RubyGems, and so on. What is the best option for JavaScript? I ask because a few months ago I ported Statistics::Distributions from Perl to JavaScript. (When I say ...

How do I chain my own JavaScript into the client side without losing PostBack functionality

So I was reading these Asp.Net interview questions at Scott Hanselman's blog and I came across this question. Can anyone shed some light of what he's talking about. ...

OO Javascript : Definitive explanation of variable scope

Can someone provide an explanation of variable scope in JS as it applies to objects, functions and closures? ...

What are the quickest and easiest ways to ensure existing web pages display well on mobile platforms?

The pages in question contain a lot of javascript and CSS. How well are these supported by mobile platforms generally? Is there a browser emulator (or equivalent tool) to assist testing? ...

Calculate Cyclomatic Complexity for Javascript

Are there any tools available for calculating Cyclomatic Complexity in Javascript? I've found it a very helpful metric in the past while working on server side code, and would like to be able to use it for the client side Javascript I write. ...

Calculate Average Lines of Code per Method for Javascript

Are there any tools available for calculating the average number of lines of code per method? I want to know the average size of each method, not just the total number of lines in the project. The per method count will allow me to measure how simple each method is. This will be calculated as part of the build process, and displayed on ...

javascript XSLTProcessor occasionally not working

The following javascript supposes to read the popular tags from an XML file and applies the XSL Stylesheet and output to the browser as HTML. function ShowPopularTags() { xml=XMLDocLoad("http://localhost/xml/tags/popular.xml?s=94987898"); xsl=XMLDocLoad("http://localhost/xml/xsl/popular-tags.xsl"); if (window.ActiveXObject...

Encoding spaces with the javascript encodeURIComponent function

Why does the javascript function encodeURIComponent encode spaces to the hex unicode value %20 insteady of +. Should uri parameters not spaces to +? ...

Best Javascript drop-down menu?

I am looking for a drop-down JavaScript menu. It should be the simplest and most elegant accessible menu that works in IE6 and Firefox 2 also. It would be fine if it worked on an unnumbered list (ul) so the user can use the page without JavaScript support. Which one do you recommend and where can I find the code to such a menu? ...