javascript

What is an efficient way to set CSS class for each cell in a given table row?

I have a problem setting the CSS class for each cell in a given table row. Initially I thought setting the parent row CSS would affect the style properties of cells, but that doesn't work. Instead I have to loop through all the cells in a given row to updated the CSS class. However this is not efficient. And it took a lot of time. Cons...

range - how to select new inserted node automatically ?

hi, i have range> newNode = document.createElement("span"); newNode.innerHTML = 'example'; range.insertNode(newNode); i insert new node. is there way, how to automatically select this newNode (as it appears on page, it is not selected) ? thanks. ...

How to select multiple files with <input type="file">?

In gmail,I can select several files at one time, How to implement it? ...

Google Maps API, problem creating mutliple markers with infowindows via loop

The problem I am having with the below code is that the info window only pops up on the last iterated marker, even when i click on the first marker the infowindow on the last marker is opened? $(document).ready(function(){ if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map_canvas")); map....

Enabling cross domain scripting in the intranet

Hi, I'm having a few problems with an application that integrates sharepoint, SQL reporting services and a bunch of custom forms that are built using ASP.NET MVC. Assuming my servers are as follows; MOSS SSRS Custom forms In MOSS, my portal has need on occassion to popup a custom form to capture user input. I've done this by using ...

Javascript after window.onload?

I have an asp.net page that loads some javascript scripts. One of those scripts loads some controls into the page appending them to the body in the window.onload event. I need to inject a script via code behind to call a method of the scripts that depends on the controls created in the window.onload. This doesn't work because every call...

IDE capable of saving to two locations and a SVN repo?

I’m just wondering if anyone’s come across or could recommend an IDE that’s capable of the following: Key requirements: Save to two locations as a part of the normal save operation. (Local or network drive and a web server dev box.) Subversion integration (in addition to the above). Windows based Code highlighting (and ideally functio...

How to prevent form submiting before DOM is ready?

I'm using javascript to validate the form, but can't handle the case when the form is submitted before DOM is ready I tried : <form method="POST" disabled="disabled"> <input type="submit" /> </form> But the form can still be submited. ...

For a Google Wave Gadget, is there a defined point at which it's ok to modify UI?

I'd like my gadget to have two different views: One when it's just been added, to let the user enter some information, and, once he's done with that, another which displays some data based on that information. The earliest point at which I can decide which of those two views I have to display is when I get the state for the first tim...

jQuery script doesn't work in safari when button is disabled

I wrote this simple piece of code to prevent a form from being submitted more than once. jQuery.fn.preventDoubleSubmit = function() { this.find(":submit").each(function() { $(this).click(function() { this.originalValue = this.value; this.disabled = true; this.beenClicked = true; }); }); // [...] retu...

jQuery like image swap in YUI

Hi, Im trying to replicate a simple hover effect in YUI just like you would with jQuery however its a little confusing. As in jquery it would go: $('.hoverclass').hover(function() { $(this).addClass('up'); }, function() { $(this).removeClass('up'); }); Any pointers how to do it in YUI? Thanks. ...

Left Trim in Javascript

Hey guys, there are lots of scripts out there to trim a string in javascript, but none how to Left Trim String. This is what I use to trim: String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g,""); } But I would like to change this a little and create a new function called leftTrim that only removes the leading s...

IE7 - Save web page as .MHT and iframes

Hi, I'm trying to save a web page as MHTML (.mht) file in Internet Explorer 7. I googled and found some javascript lines + an activex to accomplish that: <script type="text/javascript"> function save() { document.all.WebBrowser.ExecWB(4,1); } </script> <object id="WebBrowser" width='0' height='0' classid="CLSID:8856F961-340A-11D0-...

Can css affect elements added by document.write?

If I have this css div.myContainer img.noCampaign { display:none; } and this html/javascript <div class="myContainer"> <script>document.write('<img class="noCampaign" src="whatever.jpg" />');</script> </div> I can't seem to get the img element to disappear? Is there no access to the img element through css when dynamically addi...

How to prevent the default action with mootools

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> <script language="JavaScript" src="mootools-1.2.3-core-nc.js"></script> <script language="JavaScript" src="mootools-1.2.3.1-more-nc.js"></script> </HEAD> <BODY id='body'> </BODY> <Script> function onkeydown(e){ ...

What is the intended purpose of eval in JavaScript?

Possible Duplicate: When is JavaScripts eval() not evil? I know, generally using eval() is bad practice. But for what purpose it is existed there? What is the correct purpose of eval()? At what situation it is better to use eval()? ...

Nested tooltip (tooltip within tooltip)

I have a page which is having some link and when i click on that link it open a tool tip form that also contains some link and now i want to open another form within already opened tool tip. Is there any possible way? Please help. ...

posting direct form - checkboxes are ignrored

Hi I'm using the Ext.Direct.Mvc stack - when i submit a direct form - everything but the checkboxes get submitted correctly. no matter what way they are checked they always get submitted as false? has anyone seen this too? w:// ...

javascript conversion of yyyy-mm-dd hh:mm:ss aa help

Hi, can anybody spot any mistake in this function? .. This is a function which receives a string of type yyyy-mm-dd hh:mm:ss aa and converts to UTC and builds up a string yyyy-mm-dd hh:mm:ss. function LocalTimetoUTC(localTime) { var time = localTime.split(" "); //Received :- yyyy-mm-dd hh:mm:ss aa var yearday = time[0].split("-...

Best book to learn web development for a professional developer?

I'm a professional software developer. I've been programming in a lot of different languages over the course of more than two decades now. Picking up a new programming language is very easy for me. However, I have no knowledge or experience whatsoever developing modern AJAXy web applications. What I need is a book that gives me a goo...