javascript

The best format of data to send from browser to the java-based server with ajax?

I don't have a big experience in this kind of things, so I see the easiest way is sending key-value pairs as post parameters and then servlet container will parse these pairs and put to the parameters map. But I assume that there can exist more convenient way based on using some ready solutions (libs) that's why (and what) I'm asking. O...

javascript learning resources

i am a programmer i want to learn javascript what are the best resources where i can learn from? ...

change select element?

I want to see if this is possible, i need to change a select element content to be displayed as divs using images just like a color picker. when the user selects clicks on a colored div i want an image to be displayed on the page. Also would i still be able to capture the selected item in a form hidden field? It's a shirt building page,...

Load two dropdowns with the same values

Hi all: Is there any problem with loading the same set of values in 2 different HTML form dropdowns? My code looks like this: var dr1=document.getElementById("dr1"); var dr2=document.getElementById("dr2"); for (nombre in elements) { var opcion=document.createElement('OPTION'); var cam=elements[nombre]; opcion.value=nombre; ...

Sencha Touch Tab Handlers

I'm trying to do a Tabpanel in Sencha Touch and add a handler to one of the buttons, but the event doesn't fire when I click it. Any ideas? Here is the code: The handler: var handler = function(button, event) { var txt = "YES!"; alert(txt); }; And the item: items: [{ xtype: 'button', title: ...

Parallel JavaScript Code

Is it possible to run JavaScript code in parallel in the browser? I'm willing to sacrifice some browser support (IE, Opera, anything else) to gain some edge here. ...

Can AJAX request data from a remote server?

Hello! Can I use XMLHttpRequests in JavaScript to request a file on a different server than the one from where the request was made? Thank you. ...

Is it possible to connect to SSH using JavaScript?

I know there is an implementation of VNC using WebSockets (http://novnc.com) but that still requires a server. I am looking to create a simple client-side JavaScript only (no Flash) connection to a port running SSH. I am guessing WebSockets is the only way to go since it does TCP. Any example code? Any other way? ...

"fadeTo" seems to have a bug when I scroll through images too fast.

I am slowly learning how to modify and write jQuery from scratch and have been trying to modify some pre-written code, which simply makes an image opacity: 1 and all other images in the same HTML element opacity: 0.2. When I use fadeTo and I move across the images fast it will stop doing the animation and hang for a while until it fixes...

automatically adjust google map zoom to accomodate marker points in a google map

Using the latest version of google maps. How to add markers using longitute and latitude and automatically adjust the zoom level of the map to include all the markers using javascript. ...

validate code entered into a form

i am trying to setup a simple javascript form. User must enter correct discount code. If not they get an error message. if correct, they are directed to another website. any help would be greatly appreciated! ...

Google Maps API in ASP.NET Masterpage: why it stays blank ?

This simple example works in pure html when launching within visual studio localhost:port server <!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0px; padding: 0px } #map_canvas { height: 100% } </style> ...

Help with Form Validation

I want to validate a form. How do I do that? I have email,username,password as my fields. I don't want any of them to be NULL and password and confirm password should match. Please help me out. Thanks. ...

What's the javascript equivalent of ruby's "inspect"?

In ruby, you can do foo.inspect() and it outputs something sane for any object pretty much regardless of type. How do I achieve the same thing in Javascript? ...

Change the filename of a downloaded file hosted on another website

Is it possible to create a download link for a file on another site and change the file name? Can it be done without proxying it through my server? I'd like to achieve it without any additional bandwidth cost if possible. EDIT: Just an idea but can it be achieved with a flash downloader of sorts? ...

dojo clone event handlers

Hi. I'm using dojo.clone(obj) for clone DOM node, but i don't know how clone event handlers. does anybody know how do this? ...

How do I click a javascript button with htmlunit?

I'm working on an application that will automatically click a button on a webpage using htmlunit in Java. Only problem is that that button is a javascript button, so the standard getInputByName() won't work. Any suggestions with dealing with this? The code for the button is included below. <a class="vote_1" id="1537385" href="/javascrip...

verify before confirmation message

I'm trying to check if the '#text' (id for a textarea) is empty when I change '#my_selection' (id for a drop-down select) option. And if NOT EMPTY (ie, there's some text in the textarea), I would like the confirmation to pop up, else don't want to change the '#my_selection'. Many thanks in advance. var selected=$('#my_selection').val()...

Adding Javascript effects to a form in RoR

Hopefully I can be clear on my issue. If you need more clarification on what I mean, please let me know and I'll try to clear up anything I can. I am currently working on a simple Ruby on Rails project and I want to add some interactivity to my login form. Currently, the login form works fine if you click the Login link which then take...

Javascript or PHP or Zend Framework - how to check previous url?

Note: For marketting analyze, this url is in many other websites (ex: http://mysite.com/marketting ). So user clicks it and comes to my site. Problem: But how can i check from where he came from? Did he came from facebook/ or google.com/ stackoverflow.com or wordpress.com or etc.com How can you find, which link he clicked and reached t...