javascript

Is there an Erase for dojo's gfx surface routines?

I'm using Dojo's gfx routines to draw some shapes onto a div, and other than surface.clear(), is there a way to clear or erase just part of the surface? Thanks. ...

How to get selected text from textbox control with javascript

I have a textbox and a link button. When I write some text, then select some of them and then click the link button, selected text from textbox must be show with a messagebox. How can I do it? ...

jQuery hover and class selector.

I wan't to change the background color of a div dynamicly using the following HTML, CSS and javascript. HTML: <div id="menu"> <div class="menuItem"><a href=#>Bla</a></div> <div class="menuItem"><a href=#>Bla</a></div> <div class="menuItem"><a href=#>Bla</a></div> </div> CSS: .menuItem{ display:inline; height:30px; w...

Preventing AJAX memory leaks.

I am working on a web application that is designed to display a bunch of data that is updated periodically with AJAX. The general usage scenario would be that a user would leave it open all day and take a glance at it now and then. I am encountering a problem where the browsers memory footprint is growing slowly over time. This is h...

jQuery - How to Select Multiple Descendants?

I have this form: <form name="customize"> Only show results within <select name="distance" id="slct_distance"> <option>25</option><option>50</option> <option>100</option><option value="10000" selected="selected">Any</option> </select> miles of zip code <input type="text" class="text" name="zi...

Multi file upload with PHP/Javascript and no flash

I'm trying to make a webpage that allows the uploading of multiple files at the same times. I will limit the file extensions to the most common images like JPG, JPEG, PNG and GIF. I've done some research on this and everywhere I look it's flash this and flash that. I don't want to use flash really. Especially with Flash 10, which disab...

Javascript: how to validate dates in format MM-DD-YYYY?

I saw a potential answer here but that was for YYYY-MM-DD: http://paulschreiber.com/blog/2007/03/02/javascript-date-validation/ I modified the code code above for MM-DD-YYYY like so but I still can't get it to work: String.prototype.isValidDate = function() { var IsoDateRe = new RegExp("^([0-9]{2})-([0-9]{2})-([0-9]{4})$"); ...

How can I override the OnBeforeUnload dialog and replace it with my own?

I need to warn users about unsaved changes before they leave a page (a pretty common problem). window.onbeforeunload=handler This works but it raises a default dialog with an irritating standard message that wraps my own text. I need to either completely replace the standard message, so my text is clear, or (even better) replace the ...

Can you change the height/width of an ASP.NET control from a Javascript function?

What is the best way to change the height and width of an ASP.NET control from a client-side Javascript function? Thanks, Jeff ...

find mobile browsers

Hi friends, I want to check whether my site is viewing in mobile or PC. If its mobile device, i need to redirect my site url; like Google does.. If possible Get me code in javascript Please clarify my doubt.. How to check it browsed from mobile or PC.. ...

How can I see the machine code generated by v8?

Does anybody know how I can see the actual machine code that v8 generates from Javascript? I've gotten as far as Script::Compile() in src/api.cc but I can't figure out where to go from there. ...

How to set the focus to the first input element in an HTML form independent from the id?

Is there a simple way to set the focus (input cursor) of a web page on the first input element (textbox, dropdownlist, ...) on loading the page without having to know the id of the element? I would like to implement it as a common script for all my pages/forms of my web application. Thanks! ...

Calling c# function from javascript

Hi, I want to call a c# function from my javascript function. I have a link button in my ascx (please see the code below). The problem is that if you press enter in firefox is not working however it is working fine in internet explorer. <li class="clearfix border_top"> <label for="title" class="first_column bold">Search For</label> <d...

how to disable default context menu for certain elements in mozilla using Prototype?

I'm trying to expand navigation options of the context menu on certain elements (specifically, h1 and h2 tags) I want to prevent the browser's default action when right-clicking on those elements. I found nice information at this page. However, I couldn't find how to disable the context menu for certain elements. Does someone know how ...

JSEclipse Alternatives in Ganymede

I've been having a lot of problems with JSEclipse in Ganymede, but I haven't had much luck finding an alternative that's compatible with Ganymede (eclipse 3.4). All I'm really looking for is code-highlighting. Anyone have any good alternatives, or do I just need to suck it up and get on with it? ...

Javascript to sort contents of select element

Hi, is there a quick way to sort the items of a select element? Or I have to resort to writing javascript? Please any ideas. <select size="4" name="lstALL" multiple="multiple" id="lstALL" tabindex="12" style="font-size:XX-Small;height:95%;width:100%;"> <option value="0"> XXX</option> <option value="1203">ABC</option> <option value="101...

User Control in Folder Home Page Doesn't Initialize

I am programming Outlook 2003 using Visual Studio 2008. Add-in uses embedded user control in folder's home page, exactly as it was recommended. Here is HTML code that is using: <html><head><style type="text/css">body{overflow: hidden}</style></head> <body rightmargin = '0' leftmargin ='0' topmargin ='0' bottommargin = '0' onload='OnBod...

How to Force Javascript to Execute within HTML Response to Ajax Request

We're using Prototype for all of our Ajax request handling and to keep things simple we simple render HTML content which is then assigned to the appropriate div using the following function: function ajaxModify(controller, parameters, div_id) { var div = $(div_id); var request = new Ajax.Request ( controller, { ...

Enumerating all strings in resx

We would like to enumerate all strings in a resource file in .NET (resx file). We want this to generate a javascript object containing all these key-value pairs. We do this now for satellite assemblies with code like this (this is VB.NET, but any example code is fine): Dim rm As ResourceManager rm = New ResourceManager([resource name], ...

Are there any known HTA file Security Issues?

Are there any known security issues related to running a web application via a .hta file. I am especially interested in the drag & drop issues related to .hta files and frames see: http://sqlblogcasts.com/blogs/jonsayce/archive/2008/01/10/drag-and-drop-problems-in-hta-frames.aspx ...