javascript

Javascript .onchange limitations

As I begin to develop more and more compliacted Javascript solutions, I wonder what sort of options javascript gives me to monitor changes in my environment. I've seen so many solutions that constantly ping whatever element they are wanting to monitor, but for any sort of resource heavy application (or for any case depending on the stand...

How do I get my widget not to crash if there is no value in a xml node?

I'm getting an xml file and want to get data from it. The source of the xml doesn't really matter but what I;ve got to get a certain field is: tracks = xmlDoc.getElementsByTagName("track"); variable = tracks.item(i).childNodes.item(4).childNodes.item(0).nodeValue; Now this works like a charm, EXCEPT when there is no value in the node....

Sorting in Web Applications

With the increasing popularity of powerful client side javascript widgets, I am curious on when is the best time to handle the sorting of data strictly on the client side, making use of widgets such as those found in YUI, and when to make a request to the backend and have it handle the sorting via a DB query or other means. ...

how to have flexible height with fixed width

The page has flexible width from 980px to 1200px Has 3 columns Left column is fixed width Middle Column is flexible and large ( so all the extra width will go into this column) Right column is fixed width Problem Middle Column store a huge articles, however when left and right column is fixed width, it set the height of the whole p...

jQuery Thickbox Issue

Hi, I'm a jQuery newb. I'm building a Online Shop and I'm using jQuery plugin 'Thickbox' (http://jquery.com/demo/thickbox). The Online Shop is set up to display a 'Enlarged Image' which runs the Thickbox JS script and shows an image. A problem occurs as the data is placed on the page thru a CMS system (using Ajax I believe?). When you...

Automated Unit testing for Javascript integrated with CruiseControl, nUnit, nAnt and ASP.net MVC

I work for a team of ASP.net MVC and they are using Cruisecontrol, nUnit and nAnt for the automated testing and build. I am new to the group and i handle the Javascript layer and i am looking for ways to incorporate my work with my teams workflow. Are there any possoble way to do this? Thanks ...

database entry through javacsript

Hi All, I'm need to know can i connect db through javascript? Actually, the last action where i end is done through javacsript. Now, i need to make some entries(extracted through javascript) in the database where last action stops. How can this be done? Khushi ...

Prevent long running javascript from locking up browser

I have JavaScript which performs a whole lot of calculations as well as reading/writing values from/to the DOM. The page is huge so this often ends up locking the browser for up to a minute (sometimes longer with IE) with 100% CPU usage. Are there any resources on optimising JavaScript to prevent this from happening (all I can find is h...

Does flot v0.5 support IE8 RTM?

flot v0.5 fails to render correctly in IE8 RTM. I am using excanvas library that comes packaged with flot (as per instructions). The project description states that IE8 is supported but doesn't mention which mode (compat or standards). Does anyone have experience using flot v0.5 with IE8? Thanks ...

How to get div from second page display in first page

In my main.html page I have a button. When that button is clicked, I need to get the content of another page. The target page has five divs, I need to catch one div and display that div data in main.html page. ...

How to retrieve coords (x,y,w,h) of a rendered canvas element?

How i can get coords of a rendered canvas element? I need them to apply clearRect, fillRect etc to its area. I get the canvas: //html <div><canvas id="canvas_id">some useless text..</canvas></div> //javascript var ctx = document.getElementById('canvas_id').getContext('2d'); Then? there is a way to get top left x, top left y, widt...

Javascript - Getting 'undefined' when trying to get array's prototype

I think its a 5am brain drain, but I'm having trouble with understanding this. obj = ['a','b']; alert( obj.prototype ); //returns "undefined" Why isn't obj.prototype returning function Array(){ } as the prototype? It does reference Array as the constructor. ...

HTML table with fixed headers?

Does anyone know a cross-browser CSS/Javascript technique to display a long html table such that the column headers stay fixed on-screen and do not scroll with the table body. Think of the "freeze panes" effect in excel. I want to be able to scroll through the contents of the table, but to always be able to see the column headers at the...

How to create a bookmarklet for creating a screen scraping?

How to create a bookmarklet like this one: http://www.vimeo.com/1626505 I want to create one the same, where to start? i want to know the work flow of how this one is working to build my own. Thanks ...

how to extract the value of a field in an iframe into the main page

Hi, I have an iframe inserted into my main page. The iframe generates a value which is of the type hidden I need to extract this value into my main page using a javascript Can someone please help me with this? ...

simple javascript "feature" panel

I'm working on a free template which has a featured Div... www.subigya.com/test/durbarsquare "In the Spotlight" is the featured div. I have simple jQuery js in there to switch the images. How do I switch the heading & related to each div in the switch. Right now, only the images switch and not the text. The script used is feature.js...

Is it possible to duplicate the native behavior of JavaScript's prompt()?

I'm rolling my own version of prompt() for aesthetic purposes; it's come along quite nicely as far as visuals go, but I have run into a slight hitch: the native version of the function causes code execution to cease completely until the prompt has been dealt with. This is positively lovely and it's why the below works the way it does: ...

How to add another text decoration definition with Javascript?

I want to add another text decoration class with the help of JavaScript to the link which already has a class associated to it. I want something like the <a> activated link should have the text:decoration=none but i am not able to do it with CSS because it gets applied to all the links, then if I declare a new class of no decoration. H...

Javascript Event caller not being passed into params

I'm working on the following onmouseover function in javascript function fnNavMouseOver(evt) { alert(evt.target); var eSrc evt = (evt) ? evt : (window.event) ? window.event : "" eSrc = (evt.target) ? evt.target : evt.srcElement alert(eSrc); } I'm under the impression that in firefox the event should be passed into ...

Why is Java giving me an IllegalArgumentException?

I'm using dwr and spring and I get this error: java.lang.IllegalArgumentException: Javascript name * is used by 2 classes I found nothing helpful on Google, do you know why I'm getting this error? <?xml version="1.0" encoding="UTF-8"?> <beans xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr" http://www.directwebre...