Category Archives: Javascript

How to get variables from a URL using Javascript

How to get variables from a URL using javascript. // ex url: http://www.example.com/index.html?hello=bonjour&goodevening=bonsoir var hash = getUrlVars(); alert(hash['hello']); // prints ‘bonjour’ function getUrlVars() { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf(‘?’) + 1).split(‘&’); for(var i = 0; i … Continue reading

Posted in Javascript | Tagged , , | 2 Comments

AJAX function using jquery

Jquery ajax function var ajax = { go: function(type, url, data, callback) { $.ajax({ type: type, url: url, data: data, success: function(msg){ callback(msg); }, error: function(XMLHttpRequest, textStatus, errorThrown){ alert(errorThrown); } }); } };

Posted in Javascript, Jquery | Tagged , , , , | Leave a comment

Calling a function from javascript to actionscript 3

Calling a function from Javascript to Flash / ActionScript 3. //Javascript———- function flashCom(flashIDName, stringVar){ var video = (isIE()) ? window[flashIDName] : document[flashIDName]; video.updateFlash(JSONString); } flashCom(“flash_object_id_name”, “string_to_be_passed”); //AS3—————- package com{ import flash.external.ExternalInterface; public class init extends MovieClip { public function init():void … Continue reading

Posted in ActionScript 3.0, Javascript | Tagged , , , , | Leave a comment