javascript

How do you clear a tree in ExtJs?

I have managed to create an Ext.tree.TreePanel that loads child nodes dynamically, but I'm having a very difficult time clearing the tree and loading it with new data. Can someone help me with the code to do this? ...

What ideas do you think can it be applied to this GUI to make it more effective for real people usage?

I am talking about Google Text Translation User Interface, in Google Language Tools. I like the fact that you can get translations of text for a lot of languages. However, I think is not so good always to show all options of translation. I believe is preferably to show, in first instance, only the most frequent options for text translat...

How can I upload files without using an HTML <form>?

Hi, in a web application I am building I need to upload photos without using a form, otherwise it will come up with form embedded in an outer from which is not permitted in XHTML. I think uploading files is what jQuery.post should be able to do, but I currently can't figure out how to do this using jQuery. ...

What is the best way to track changes in a form via javascript?

I'd like to track changes in inputs in a form via javascript. My intent is (but not limited) to enable "save" button only when something has changed alert if the user wants to close the page and something is not saved Ideas? ...

Force iframe to Load Full Frame

Hello all, I have an HTML page (say welcome.html) which contains an iframe to a page I have no control over (say app.html). The user performs some actions using the app within the iframe and clicks submit. Once they do this, they are taken to a new page (say thanks.jsp), which loads within the iframe. Is there a way in which I can fo...

How can I obfuscate JavaScript?

I want to make a JavaScript application that's not open source, and thus have two questions: What's the best way to obfuscate the code? What's the best way to obfuscate the strings themselves within the application (assuming that the answer to #1 does not handle this)? ...

"suggest" feature for textboxes in a rails app

I'm looking for an easiest way how to implement the "suggest" feature for a text entry field in a Rails application. The idea is to complete names stored in a database column, giving the user a drop-down menu of possible matches as he types. Thanks for any suggestions! ...

2D Javascript array

Simply put, is there a way to create a 2D javascript array using similar syntax to this? var newArray = [ [0, 1, 2], [3, 4, 5], [6, 7, 8] ] ...

Image Zoom using javascript?

Has anyone got to some good code to zoom into an image using javascript? I know I could just resize it etc but was being lazy and looking for something clever to zoom to different levels, move around when zoomed etc ...

Automatic two columns with CSS or JavaScript

I'm currently developing a website and my client wants the text of various articles to overflow into two columns. Kind of like in a newspaper? So it would look like: Today in Wales, someone actually Nobody was harmed in did something interesting. the incident, although one Authorities are baffled by this elderly v...

Is there any kind of hashCode function in javascript?

Basically what I'm trying to do is create an object of unique objects, a set. I had the brilliant idea of just using a JS object with objects for the property names. Such as, set[obj] = true; This works, to a point. It works great with string and numbers, but with other objects, they all seem to "hash" to the same value and access the ...

Is It Possible to Sandbox JavaScript Running In the Browser?

I'm wondering if it's possible to sandbox JavaScript running in the browser to prevent access to features that are normally available to JavaScript code running in an HTML page. For example, let's say I want to provide a JavaScript API for end users to let them define event handlers to be run when "interesting events" happen, but I don'...

Can I turn off antialiasing on an HTML <canvas> element?

I'm playing around with the <canvas> element, drawing lines and such. I've noticed that my diagonal lines are antialiased. I'd prefer the jaggy look for what I'm doing - is there any way of turning this feature off? ...

Internet Explorer Debug Mode - Is there a quick way to enable/disable it?

I do web site debugging with IE (as well as other browsers) but my problem is with IE, as it is the browser i usually use for regular browsing. In order to debug you need to turn on debug mode in the advanced options. Ok, fine. Its turned on. But the issue I have that is quite annoying is that it seems 30% of websites have JS errors, an...

Inserting a newline into a pre tag (IE, Javascript)

In IE when I insert text into a <pre> tag the newlines are ignored: <pre id="putItHere"></pre> <script> function putText() { document.getElementById("putItHere").innerHTML = "first line\nsecond line"; } </script> Using \r\n instead of a plain \n does not work. <br/> does work but inserts an extra blank line in FF, which is not a...

Limit displayed length of string on web page

I'm looking for a technique (javascript, CSS, whatever ???) that will let me control the amount of a string that is displayed. The string is the result of a search (and therefore not initially known). A simple Character count approach is trivial, but not acceptable, as it needs to handle proportional fonts. In otherwords if I want to lim...

Is Javascript a proper platform for cryptography? Or, can it be?

I noticed a good while back that Wikipedia links to a Javascript implementation of different hash functions. Also found Clipperz Crypto. Even Mozilla implements a crypto object in Firefox. So, Is Javascript a proper platform for cryptography? Or, can it be? Or, I suppose.. Are there any purposes or benefits for hashing data before POST?...

How to prevent iframe load event?

I have an iframe and couple of tables on my aspx page. Now when the page loads these tables are hidden. The iframe is used to upload file to database. Depending on the result of the event I have to show a particular table on my main page (these tables basically have "Retry","next" buttons...depending on whether or not the file is uploade...

In search of JavaScript Month Picker

I'm in search of a JavaScript month selection tool. I'm already using jQuery on the website, so if it were a jQuery plugin, that would fit nicely. I'm open to other options, as well. Basically, I'm after a simplified version of the jQuery UI Date Picker. I don't care about the day of the month, just the month and year. Using the Date Pi...

Change an element's CSS class with JavaScript

How can I change a CSS class of an HTML element in response to an onClick event using JavaScript? ...