javascript

How best to make the selected date of an ASP.NET Calendar control available to JavaScript?

How best to make the selected date of an ASP.NET Calendar control available to JavaScript? Most controls are pretty simple, but the calendar requires more than just a simple document.getElementById().value. ...

Code reviews on the web for PHP and JavaScript code

What are the best places for freelancers or small companies to get code reviewed for PHP and JavaScript? Forums are an option, but are there any sites dedicated specifically to code reviews? Edit: Just for clarification, I'm looking more for a website to get the code critiqued by others than a tool that helps perform internal code revi...

Javascript and why capital letters sometimes work and sometimes don't.

In notepad++, I was writing a javascript file, and something didn't work: an alert had to be shown when a button was clicked, but it wasn't working. I has used the auto-complete plugin provided with Notepad++, which presented me with "onClick". When I changed the capital C to a small c, it did work. So first of all, when looking at th...

Tell if a Javascript function is defined by looking at self[name] - is this a good way?

This is a follow up question to This Question. I like (and understand) the solution there. However, in the code I am working in, another way to solve the same problem is used: function exist(sFN) { if(self[sFN]) return true; return false; } It seems to work fine, although I don't understand how. Does it work? How? What are m...

Queuing actions (not effects) to execute after an amount of time.

What I'd like to know is if there is a nice way to queue jQuery functions to execute after a set amount of time. This wouldn't pause the execution of other functions, just the ones following in the chain. Perhaps an example of what I'd envisage it would look like would illustrate: $('#alert') .show() .wait(5000) // <-- this b...

Is the YUI Loader Utility reliable?

I've been using the YUI Components and want to begin using the Loader Utility to specify my dependencies on my page. From your experience, is the YUI Loader Utility a reliable way to load Javascript dependencies in web pages? ...

How to center text over an image in a table using javascript, css, and/or html?

How to center text over an image in a table cell using javascript, css, and/or html? I have an HTML table containing images - all the same size - and I want to center a text label over each image. The text in the labels may vary in size. Horizontal centering is not difficult, but vertical centering is. ADDENDUM: i did end up having to ...

How to implement a web page that scales when the browser window is resized?

How to implement a web page that scales when the browser window is resized? I can lay out the elements of the page using either a table or CSS float sections, but i want the display to rescale when the browser window is resized i have a working solution using AJAX PRO and DIVs with overflow:auto and an onwindowresize hook, but it is cu...

Make Web Application Accessible

What things have to be done before I can honestly tell myself my web application is accessible by anyone? Or even better, convince Joe Clark. I don't have any video or audio to worry about, so I know I won't need transcripts. What else do I have to check? ...

How to trace javascript events like onclick onblur?

Is there a way to debug/trace every javascript event in Internet Explorer 7? I have a bug that prevents scrolling after text-selecting, and I have no idea which event or action creates the bug. I really want to see which events are being triggered when I move the mouse for example. it's too much work to rewire the source and i kinda h...

javascript message box

Dear all; I want to display an error message on my asp.net application. This message is a warning message, this is the way I did it: CmdCalcInvoke.Attributes["onclick"] = "return confirm('Are you sure you want to calculate the certification? WARNING: If the quarter has not finished, all the partners status will change')"; The code abo...

jQuery attribute selectors: How to query for an attribute with a custom namespace

Suppose I have a simple XHTML document that uses a custom namespace for attributes: <html xmlns="..." custom:xmlns="http://www.example.com/ns"&gt; ... <div class="foo" custom:attr="bla"/> ... </html> How do I match each element that has a certain custom attribute using jQuery? Using $("div[custom:attr]") does not work. ...

JavaScript RegEx Help

I'm trying to match elements with a name that is 'container1$container2$chkChecked', using a regex of '.+\$chkChecked', but I'm not getting the matches I expect when the element name is as described. What am I doing wrong? ...

Maven plugins for javascript

Javascript code can be tough to maintain. I am looking for tools that will help me ensure a reasonable quality level. So far I have found JsUNit, a very nice unit test framework for javascript. Tests can be run automatically from ant on any browser available. I have not found yet some javascript equivalent of PMD, checkstyle, Findbug... ...

How to call an Objective-C method from Javascript in a Cocoa/WebKit app?

I have a Cocoa app that uses a WebView to display an HTML interface. How would I go about calling an Objective-C method from a Javascript function within the HTML interface? ...

jQuery/Javascript to replace broken images

I have a web page that includes a bunch of images. Sometimes the image isn't available so a broken image is displayed in the clients browser. How do I use jQuery to get the set of images, filter it to broken images then replace the src? --I thought it would be easier to do this with Jquery, but It turned out much easier to just use a...

Is "Partial Function Application" a misnomer in the context of Javascript?

A friend of mine and I were having a discussion regarding currying and partial function application in Javascript, and we came to very different conclusions as to whether either were achievable. I came up with this implementation of Function.prototype.curry, which was the basis of our discussion: Function.prototype.curry = function() { ...

Any Yahoo YUI validation framework that I can implement in asp.net MVC?

Hi, Has anyone seen a Yahoo YUI validation framework that I could implement into asp.net MVC? I've seen a jQuery one but I want to work wit YUI. ...

Which Javascript engine would you Embed in an application?

Just to make it clear, I'm not interested in DOM scripting or writing Javascript in a browser. What I want to do is embed Javascript in a hobby game engine of mine. Now that we have the 5th generation of Javascript engines out (all blazing fast) I'm curious what engine would you choose to embed in a C++ framework (that includes actual ea...

Best cross-browser method to capture CTRL+S with JQuery?

My users would like to be able to hit Control+S to save a form. Is there a good cross-browser way of capturing the Ctrl+S key combination and submit my form? App is built on Drupal, so jQuery is available. ...