javascript

Using Javascript (Google Visualization API) with Drupal Form API

The situation I am implementing a few forms using the Drupal Form API. As a result of user selection i need to display a visualization (area chart, time line, etc) where i have to load the google's JS libraries and send data to display the visual in a div element. What I have Done: I have tried to load a local JavaScript file(this in...

Paint rounded border around image using Raphael

Hi, I'm using the Raphael JavaScript library. I'd like to draw a border with rounded edges around an image (which is a Raphael object) but I can't seem to figure out how to do that. I tried to set a stroke but it doesn't appear. I have this: var paper = Raphael(10, 50, 500, 500); var google_img = paper.image("http://www.google.com/imag...

How facebook.com chat working, with few different domain name?

How facebook.com chat working, with few different domain name? GET http:// www.facebook.com/ajax/presence/reconnect.php?__a=1&reason=6&iframe_loaded=false&post_form_id=23be2df75b74a0bcb61358814c56ba4f 200 OK GET http://0.50.channel.facebook.com/x/2562941315/4271808869/true/p_1529934952=2 200 OK I want something like, with jQuery... B...

JQuery to determine if all checkboxlists (in div) have been checked

I am trying to use jQuery to do some validation on a form; I need a method where I can validate if all controls in a have been filled out \ selected. The CheckBoxLists my application supports are giving me a hard time as it seems like jQuery likes to address each checkboxes individually, but what I really need to do is evaluate all CBLs...

mobile safari, how to get the innerHTML of the touched div

The following works well in desktop browser evt.target.innerHTML but doesn't work so well on mobile safari on the IPad. You have to click on the exact top of the div, which can be difficult. I also tried doing something like var x = evt.pageX, y = evt.pageY, div = document.elementFromPoint(x, y); but x and y are zero....

How to get my specific link details from google analytics

I have a page like for example: http://www.stackoverflow.com/how-many-users-visited I have inside that page already those google analytics javascript under my UA-0000-1 account. var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-xxxxxx-1']); _gaq.push(['_trackPageview']); (function() { var ga...

Parsing JSON with Javascript

I have a webservice (RestEasy) returning a JSON object containing a List<..> element. I am trying to parse the results in a Javascript for loop. If the List<> element has 2 or more elements, all is well. If the List<> element has only one element, the Javascript loop breaks. This is because the JSON respresentation actually changes when...

Raphael Position

How can I get the position of an object in Raphael? I can get the size using getBBox(), but there appears to be no way to get the position? ...

Does the ListBox SelectedIndexChanged event require postback in ASP.NET?

I'm trying to add a JavaScript function to show all selected items from a ListBox as concatentated strings in a Label on the page. It's needed because AutoPostBack="true" will cause the ListBox to scroll all the way back to the first selected item. So this code works: <script type="text/javascript"> function Updatelist() { ...

javascript web workers - how do I pass arguments?

Hello, Found the answer some some of my problems, html5 web workers!!! How do I pass an argument to a web worker though using this basic example? contents of worker.js: function doSomething() { postMessage( ' done'); } setTimeout ( "doSomething()", 3000 ); js code: var worker = new Worker('worker.js'); worker.onmessage = fu...

Select List with multiple enabled doesn't fire onchange event on iPad

I have a form with a select list that allows users to choose multiple items. I am using $('#my_form select').change(validateInput); to fire an onChange event whenever an item is selected or de-selected in my select list. It works fine on my desktop machine but the validateInput function does not run on iPad. If I change my select list...

A problem with JavaScript size animation

Hi! I am in the middle of writing a JavaScript library and I have hit a problem, I have a function that resizes elements, that all works good but I also have and animated version that resizes them over a specified time frame. The script seems to freeze when ever it is run and it seems to be down to my while loop, here is my code. // Res...

Scroll scrollbar in browser without using window.scrollBy

Hi All. I am trying to create a board game using html/css/javascript to be played on the iphone. My board is a 2d grid designed using a table with 128 elements both in height and width and each element is 128x128px. I want the game to start in the center of the board. That is the vertical and horizontal scrollbars roughly in the center o...

Free/cheap Whois Api

Is there a free API where I can pull whois data and server location data? (similar to who.is) ...

Whats wrong with my ajax request?

<script type="text/javascript"> var t; function tick() { xmlhttp=new XMLHttpRequest(); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200 && document.getElementById("txtHint").innerHTML!=xmlhttp.responseText) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } }...

Randomly generate a point within a country boundary polygon

I'm interested in pulling street view data at random within a country. I can only figure out how to generate a point within a bounding box. Often it pulls data from nearby nations. I'm using a GIS server right now, but I'm interested in removing it from the workflow since it's a pain. Anybody know of any javascript mapping API th...

Which swfobject.js file?

Hey guys.... this may be a stupid question, but I downloaded SWFObject & it came with several files.... it has one swfobject.js file in the root dir & another in the "src" directory.... their file size differs so I'm wondering which one I have to include in my header? Thanks! ...

Adding Zoom & Pan for Protovis Dot Chart with GeoScale

var w = 810, h = 400, mapMargin = 30; geo = pv.Geo.scale().range(w, h); var vis = new pv.Panel() .width(w) .height(h) .top(50) .bottom(30) .def("i", -1); var dot = vis.add(pv.Dot) .data(geoPopList) .left(function(d) {return geo(d.center).x}) .top(function(d) {return geo(d.center).y}) .radiu...

Javascript : Change selection background

How should I do this in Javascript? // CSS *::-moz-selection{ background:transparent; } I tried these but doesn't really works: // Javascript document.mozSelection = "transparent"; document.body.mozSelection = "transparent"; ...

swapping images of different sizes [Javascript vs IE]

Hello, I have the following simple preloading function which substitute an image "src" attribute with another image (an animated GIF "Loading"). The problem arises only in IE: if the "loading" GIF is smaller than the actual image src, that will be resized. For example if I have a square 100px image and preload it, the image is temporarly...