I'm inspecting today's Google Doodle celebrating Robert Moog. It's all JavaScript it seems. I know how to play prefabricated sound wave files and generate sound files on-the-fly using JavaScript, but this seems to go way beyond that. How...
Background  I am trying to learn promises, and I have a promise chain I want to improve on.  Problem  While learning how to chain promises, I fail to see why anyone would rather return a promise instead of returning it's value.   Take the followi...
In HTML5 we have the <input type="search" /> which acts differently on multiple browsers.   Webkit adds a clear button when text is added and Firefox does not.  Is there a way; other than browser sniffing, to detect if the clear button...
I have a table that makes extensive use of the features in Google Charts' Table Chart, notably, sorting by selected column and color gradients.  I'd like to add a sparkline column.  Can anyone suggest methods for doing so?  Google Sparkline d...
I want to create new divs as the page loads. These divs will appear as an ordered group which changes depending upon external data from a JSON file. I will need to do this with a for loop because there are over 100 divs needed.  So, I need to be able...
I'm developing firefox plugin and I want to read file using WinApi.  I manage to connect with WinApi and it works fine.  var lib = ctypes.open("user32.dll"); var msgBox = lib.declare("MessageBoxW",                        ctypes.wi...
Facebook: http://static.ak.fbcdn.net/rsrc.php/v1/yh/r/u2OL99TwlfU.css  Google: http://ssl.gstatic.com/gb/js/sem_cf9545d69b4bd3d22ed10206010c8b23.js  There are other sites, like Tagged which also uses this kind of method.  How do these sites and other...
Does Kyle Simpson's "OLOO (Objects Linking to Other Objects) Pattern" differ in any way from the the Prototype design pattern? Other than coining it by something that specifically indicates "linking" (the behavior of prototypes) a...
I'm using a CSS grid system which is based upon percentages. I have a grid with 4 columns, each 25% of the page's total width. I output my image tags inside of each "25% cell" like this:  <img src="foo.jpg" style="max-w...
I know this is possible and can be done, or at least used to be like that.  Now I can't find the code anywhere.   I want to close the fancybox within the iframe on document ready from the parent page.  How to do this? Any help is appreciated!...
Is it possible to have focus events bubble in protoype?  I am trying to prevent having to assign an observer on every input element.   <script language="javascript" type="text/javascript"> document.observe('dom:loaded',...
Unfortunately, this may not be a valid Code-Golf question as it is likely Javascript only; however, since this is likely to be the only useful-in-the-real-world code-golf contest I'm going to go ahead and post it.    The Google Analytics Asyncron...
In an iOS app I'm developing, I show an UIWebView to allow the user to upgrade their account. The page contains links to show the user other informations, but you hold your finger on the link, a menu like this will pop up:   As you can see, it re...
Here's the dilema, I have a webpage (only for android devices) and in that page I have an input box (a text box specifically) and when it gets focus the browser zooms in. I don't want it to zoom in - sounds easy, right?  Here's where it g...
I'm trying to geolocate with the navigator.geolocation.getCurrentPosition() function, but I can't seem to get it working on firefox. More specifically, I made a very simple HTML file:  <!DOCTYPE HTML> <html> <head> <scrip...
I am experimenting with EaselJS and 2 animation instances using sprite sheets and 2 separate canvases at different positions with the same z-index, they aren't layered.  What I have now are two EaselJS functions each with a different stage and sp...
I'm trying to use the 'roles' package available on Atmosphere but I can't get it to work with Accounts.onCreateUser(), I can get the example on github. When I register a user, I want to add a role to them, when I test whether the role...
There is a jquery mobile submit form which I am using to save values into the SQL database. Once the values are stored successfully in DB a popup is opened.   The problem being that the popup doesn't open when the submit button is clicked. I need...
I have the following code attached to an item on a web page:  (function(){   var vName = $("#NAME").substr(2);   $("#NAME").ondblclick   = new Function("vName+".remove();");   $("#NAME_2").ondblclick = new Function...
I'm used to code with Java with many files with object paradigm and MVC pattern with packages.  And I begin with AngularJS, I'm trying to enable a simple index.html who use a controller in javascript file but doesn't work.  my html file :...
I was looking at Mozillas developer site on javascript closure and they had this example of code.    function makeAdder(x){     return function (y) {         console.log(y + " this is y")         console.log(x + " this is x")...
I have a little problem: slideHelpers.total = 4  for (i=1;i <= slideHelpers.total; i++) {     $('<a href="#">' + i + '</a>').bind('click', function(){ alert('go to the ' + i + ' slide')})...
In a Django template, I have a function  function show_graph(i){     $("#"+i+"seegraph").click(function(){         $("#"+i+"graph").show();      var qaa = {{ question_ids }};      var qid = qaa[i-1];         jQuery.aja...
I want to show a div which is always visible even as the user scrolls the page. I have used the CSS position: fixed; for that.  Now I also want to show the div at the right hand corner of the parent div.  I tried to use this CSS code to achieve the g...
I'm trying to get a Greasemonkey Userscript to work but it keeps throwing "missing ; before statement" in the Javascript error console.  The Greasemonkey docs say the line number should be ignored but since the script is quite lengthy it...
Please take a look at this example. http://jsfiddle.net/LdeWK/2/  I want to know how to bind values of an observable array. I know the problem in the example above, it is this line  <p>Editing Fruit: <input data-bind="value: $data" /...
I have two gmail accounts I created a thread consisting of five messages and retreived them with gmail gapi at this page https://developers.google.com/gmail/api/v1/reference/users/threads/get.  This is what I got:    As you can see, the ids don't...
Could any one explain how this function alert, when more no of brackets of parameters are passed. I could not able to understand it clearly.  function sum(a) {    var sum = a    function f(b) {     sum += b     return f   }    f.toString = function()...
I have the latest Chrome version (45 and also Chrome Canary which is in version 47), both with the Experimental Javascript flag enabled. I want to use ECMA6, but it doesn't work. I don't know why. Is there any trick or other flag that must be...
I'm working on the MIU system problem from "Gödel, Escher, Bach" chapter 2.  One of the rules states  Rule III: If III occurs in one of the strings in your collection, you may make a new string with U in place of III.  Which means that t...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.