javascript

Google Map Routing on my site

Hi all, Basically I want to use Routing functionality of Google Map on my system (Not the gadget provided by it) That is i will provide my own text boxes a map and on click of my custom button a route should be calculated and plotted on the map It should also be able to display the turns as in routing in gmap and do you mean thing... ...

How do jQuery objects imitate arrays?

jQuery objects act like arrays without polluting native prototypes. How is this achieved? I know it's not just objects with numeric keys - so perhaps it's just a matter of providing the respective methods (something like jQuery.prototype.indexOf = Array.prototype.indexOf). I've googled and looked at the source, but couldn't find a defi...

Showing a cursor inside a DIV

I'm trying to make a fancy editor online, and I need to give the user the impression that he's typing directly inside a DIV / SPAN / some other element. I can capture the keystrokes by routing them to a hidden text box, yes, but I want to know how to show a cursor at the right places to complete the illusion. Any ideas? ...

javascript multiple input textarea validation

Hi. I have 'n' numbers in a TEXTAREA on a form. After the user enters some value in the TEXTAREA, I need to validate it's not a duplicate of any other value. Ex : TEXTAREA_1 value = 10 20 30 40 10 It should alert and say 'value 10 was entered more than once'. Please help me with the Javascript. Thank you so much. ...

Scope Chain in Javascript

Hi, I've reading scope chain in Javascript but it didn't make any sense to me, could any one tell me what is scope chain and how it works with a graphic or something even an idiot can understand. I googled it but I didn't find something comprehensible :( Thanks in advance. ...

Is there a light-weight client-side HTML include method?

I'm looking for a light weight method for client-side includes of HTML files. In particular, I want to enable client-side includes of publication pages of researchr.org, on third party web pages. For example, I'd like to export a page like http://researchr.org/profile/eelcovisser/publications (probably just the publications box of tha...

Pushing to an Array within a jQuery each loop

I'm using jQuery to parse an XML file, and I'm trying to push each element in the XML file to an array using a jQuery .each loop. Strangely, if I alert the value of the array within the loop it comes out as it should, but if I try to alert a value in the array after the loop has finished it results in "undefined". Is there something st...

Fading Element on Scroll

I'm curious how I can create a DIV (or anything really) that I can fade (or change opacity of) when a user scrolls down the page. This DIV would sit at the top of the page, but only be clearly visible when at the very top of the page. Additionally, it would be ideal if I I could have this element fade back in onmouseover, regardless of ...

Random Color generator in Javascript

Hi there, i am not an Javascript and i need a little help. Given this function , i want to replace the color with an Random Color generator. document.overlay = GPolyline.fromEncoded({color: "#0000FF", weight: 10, points: encoded_points, ...

How to best install Rhino on OSX 10.6 Snow Leopard

I am running OSX 10.6 Snow Leopard, have downloaded rhino1_7R2 and moved it to /usr/local/ I am aware however that (while this would prevent it from being altered by OS updates) this may not be the best location for it and imagine that it may need to be connected to the Java installation. My intended use for Rhino is to run JavaScript ...

does jQuery have an effect like this? This is using prototype

http://blog.posterous.com/ Click on the comments link. Notice how the comments are loaded, kind of sliding down. ALso when you click on 'hide'. ...

Force jQuery content slider to pause on hover

I would be grateful if someone can help with with some javascript code. I have a content slider which can be found here:- link text This works fine but I would like to change the following code so that it pauses on hover. Any ideas? <script type="text/javascript"> $(document).ready(function(){ $("#featured > ul").tabs({fx:{opacity: "...

Hybrid button+dropdown HTML+Javascript control

I need a visual element on my web page to resemble a button, with an optional dropdown element on the right end. Clicking the main button will execute some default action, while clicking (or hovering) over the down arrow on the right end of the button will cause a dropdown menu to appear with variations on the action, and clicking on o...

Using JSON Data to Populate a Google Map with Database Objects

I'm revising this question after reading the resources mentioned in the original answers and working through implementing it. I'm using the google maps api to integrate a map into my Rails site. I have a markets model with the following columns: ID, name, address, lat, lng. On my markets/index view, I want to populate a map with a...

Prevent Yahoo OpenID from redirecting the page

Hi, i want to host the yahoo open-id login in an iframe. However as soon as the yahoo page loads it executes the following javascript: <script type="text/javascript">if(top == self) { document.write("") } else { top.location.href = "http://www.yahoo.com" }</script> In other words, it redirects the whole page (not just the iframe). How...

How to execute code in an iframe as soon as the page starts to load (not onloaded!)

I want to execute javascript code inside of an iframe as soon as the rendering begins, not when the document is loaded. The purpose is that i want to modify javascript behavior inside of the frame that is executed inside of an inline script block. The onload-event would execute after the inline script which would be too late. How to exec...

How to get the value inside an "object" - Javascript - Google map API

Hi, this is a simple question. In PHP, when you want to know what's inside an array, you say : print_r ($array); But how do you do it in Javascript?? When I try to print the value of "overlay", I get "object Object"... listener_rightclick = GEvent.addListener(map, 'singlerightclick', function(point, src, overlay){ if (overlay){ do...

jquery's slow animation

I've had enough with jquery's slowmolasse animation. I'm not an expert, but however jQuery internals handles animation is too slow for me. What alternatives do you suggest? I've read: http://sixrevisions.com/javascript/10-impressive-javascript-animation-frameworks/ But it would be nice to know SO's opinions on the matter. Thanks! ...

Calling a Flex/AS3 Callback from Javascript

Hi, I have a Javascript API, which should be usable with GWT and Flex. Using the FABridge it is really easy to call Javascript methods from AS3 and vice versa. But when I try to register a callback to an AS3 method in my Javascript API I get stuck. Here is a short code sample: public function initApp():void { if (ExternalInterface.a...

Non-java webApp to authenticate against Java servlet

Hi, We have a J2EE webapp deployed to JBoss. This webapp is used for authentication purposes. Now we would like to have other webApps that are not written in java to communicate and authenticate against this webapp. The reason we want to do this is: Suppose we have a small webapp that does simple task for the user. This webapp could be...