javascript

A problem with setTimeout

I recently asked a question about the same function, that solved my probelem and directed me to a tutoraial because I was using a while loop, this meant that my function did not animate, just freeze then resize. This new way, using setTimeout should work. The only thing is that it just snaps to the new size rather than animating to it. T...

What does a single vertical bar mean in JavaScript?

What does this expression mean in JS? Value |= this.value ...

Please Help ==> Ruby on Rails -- JavaScript

I have a button on my Ruby on Rails view file. Firstly when the button is clicked an ajax call is made which in response gives a json string. So far I have accomplished this task. I am stuck here: The button also redirects me to another action of the same controller. Now I want to send the json string received by javascript as a parame...

Dynamically updating html.listBox in MVC 1.0?

The client will choose an item from a dropDown list, this newly selected value will then be used to find assets linked to that selected item, these assets will then be loaded into the listBox. This sounds simple enough, and I'm aware I could use a partial View but it seems overkill for just updating one component on a form. Any ...

Ajax in bookmarklet :action done but answer not given

Hi there fellow SOers, I'm trying to do my own bookmarklet and I already tried to read some response in SO but nothing to answer the weird reaction I got from my script. I'm doing an AJAX call from my bookmarklet, so I do the little trick : var newScript = document.createElement("script"); newScript.type = "text/javascript"; newScript...

how to get a smooth Google maps panTo() when the destination is far away

I've got two points on a google map and I want to transition between them using a smooth animation. Using the map.panTo() method I can pan to them but the animation only works if the second point is less than the width/height of the map. So the idea i've come up with is to break the transition up into something like: var destination =...

Passing javascript variables to server-side C# logic

Is there a way to assign/pass/copy a javascript variable to a server side variable in C#? For the sake of argument, let's say that I was able to parse some JSON for variables that I want to store and assign them on the client (ie. var = FirstName and var = 25 and var = someDateTime, etc) . ...

Google Maps v3 hide elements (roads, roadsigns, etc)

I found a code snippet on http://www.41latitude.com/post/1268734799/google-styled-maps: [ { featureType: "administrative", elementType: "labels", stylers: [ { visibility: "off" } ] },{ featureType: "poi", elementType: "labels", stylers: [ { visibility: "off" } ] },{ featureType: "wat...

Javascript event to detect a link being followed

Apart from the obvious onclick event handler, how can I detect if the user tabbed the link and hit enter or whatever other key/device that would make the link open? Also, is it possible to detect a middle mouse button click (defaults to open in new tab)? ...

Can I use JavaScript to generate an RSS (XML) page?

I'm looking to retrieve JSON (from a third-party website) and convert it into a valid RSS/XML feed. Is this possible? Can RSS readers read pages that are basically only javascript generating a web page? Are there other options to convert a JSON web page to RSS? (ie. retrieve the JSON using an HTTP request and then return valid RSS) ...

Function to remove background-images for an element and all its children via javascript

I would like to remove all CSS background images for a given element and all of its children with Javascript. This question is sort-of a spin off on another question I asked. The end goal is the same, to skin jQuery UI widgets. I am currently using jquery/jquery-ui if any of would use these to solve the problem. Any ideas? bonus: ...

What Does This Mean and How Does It Help?

Hi! At the moment I'm coding a web application that imports image data from Google Maps via the Static API - http://code.google.com/apis/maps/documentation/staticmaps/ - into an HTML5 canvas. Unfortunately, I've run into the problem of not being able to manipulate the pixel data from Google Maps due to cross domain restrictions. How...

Adding form verification in this case

I've got 3 groups of radio buttons and 1 set of check boxes. How do i check if a radio button is selected in each group of radio buttons and at least one check box is selected? And if not, maybe pop an alert window. So thats : one radio button needs to be selected from all three groups and one check box (all four are mandatory). I've had...

jQuery Image Slider - Performance issues

Hello I'm currently building a simple "jQuery Image Slider" but it does not work as i hoped. It's incredible slow and unresponsive, and the last image does not do anything. URL: http://fusionmedia.dk/jquery/ What is the problem? Thanks in advance ...

Validate form with Javascript

I am trying to get a validation process to work using Javascript, my form has four radio buttons and one submit button, and I wanted to make it so if the user clicks submit and no radio buttons are selected then it pops up an alert and doesn't submit the form. Here's what my form looks like: <form method="post" name="inform"> If you che...

Update html text box while Javascript is running

Hi, I have an html file that accepts user inputs then uses Javascript to calculate a value based on those inputs. That result is then displayed in an input box after the program has finished. What I'd like to do is make it so that when you click on the button to run the javascript, the input box that displays the result will show 'Cal...

PHP/JS : Preventing doubleinserting with function

Yes im having a issue i thought i didn't have. When you submit it runs a javascript function, that runs an ajax call. This function have this right under it´s name(first line in the function): $('#submitWall').attr('disabled', true); This works very well, but not so well for the faster humans...I tried to click/pressing enter really...

Passing Array to Action from a $.post

I am having trouble passing my array via a $.post. The Javascript var privIDs = [1,2,4,5]; $.post("/Home/GrantPrivilegesToUser", { privilegeIDs: privIDs }, function (data) { alert("Data Loaded: " + data.success); }); The Action public ActionResult GrantPrivilegesToUser(int[] privilegeIDs) { return Json(new {success...

3d surface chart with javascript?

Which 3d surface chart library out there do you recommand? It is ok if it is flash or silverlight, as long as it supports dynamic data update thru json.. Thank you! Gil. ...

eclipse javascript editor '10

Hi, I am going to ask the same as http://stackoverflow.com/questions/24678/eclipse-javascript-editor because it is 2010 and answers from 2008 are not true any more. So, "I'm looking for opinions on the best JavaScript editor available as an Eclipse plugin". Many thanks. ...