Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- javascript



  Removing all child nodes from an element

When manipulating the DOM, it's often useful to remove all child nodes from a specific element. This typically comes in handy when you're looking to replace the content of an element with a separate form element, such as an <input>, so the user can edit the actual value.Here's an example of something I recently created that illustrates my point:Get the Flash Player to see this player.These "dynamic form elements" are written to the page only when the...

   Js,DOM,Remove all children,Clear,JavaScript,Code     2011-10-19 10:04:23

  UIWebView Secrets - Part1 - Memory Leaks on Xmlhttprequest

My first blog post on iphone subject reveal a big memory bug when using UIWebView component. This is the (only one) component to display some HTML content in an iphone interface. UIWebView object has a lot of differents issues and I’m going to highlight the biggest of them. Actually, all XMLHttpRequests used in javascript code are fully leaking!!! I mean when you do a request that retrieve 100ko of data, your memory used grow up for 100ko! This bug is not always active, but almost always....

   XMLHttpRequest,Memory leak,Mobile device,UIWebView     2011-11-25 13:46:30

  PHP to Objective C, where the f**k are parameters?

Javascript, PHP, Ruby functionsI assume you are very familiar with declaring functions in any of the languages above, if not, you should not be reading this. Let’s begin with a simple function to send email in these languages:// PHP or Javascript do_send_email (recipient, cc, subject, body); // Ruby do_send_email (recipient, cc, subject, body)So it’s clear by looking at the function’s signature that it takes 4 parameters and they could be optional, depends on your imple...

   Objective-C,PHP,JavaScript,Parameter,Function name     2012-01-16 09:46:09

  Gcd Algorithm with JavaScript

How to find the greatest common divisor between two integers? We may encounter this problem frequently in interviews or other occasions. An efficient metho to find gcd is the Euclidean algorithm, which uses the division algorithm in combination with the observation that the gcd of two numbers also divides their difference: divide 48 by 18 to get a quotient of 2 and a remainder of 12. Then divide 18 by 12 to get a quotient of 1 and a remainder of 6. Then divide 12 by 6 to get...

   JavaScript,Algorithm,Gcd,Implementation,     2011-09-21 15:57:32

  The seven rules of Unobtrusive JavaScript

I've found the following rules over the years developing, teaching and implementing JavaScript in an unobtrusive manner. They have specifically been the outline of a workshop on unobtrusive JavaScript for the Paris Web conference 2007 in Paris, France. I hope that they help you understand a bit why it is a good idea to plan and execute your JavaScript in this way. It has helped me deliver products faster, with much higher quality and a lot easier maintenance. 1. Do no...

   JavaScript,Feature,Tips     2012-01-18 08:21:39

  Understanding JavaScript closure and where it can be used

Closure The official definition of closure is: an expression (usually a function) that has many variables and is bound to an environment that includes those variables. In JavaScript, closure refers to the ability of a function to access the lexical scope in which it was defined, even after the function has been executed and left that scope. This ability is due to the fact that when a function is created, it generates a closure that includes a reference to the definition environment of the curr...

   CLOSURE,JAVASCRIPT,USAGE     2023-03-05 02:17:08

  What is an HTC File?

Question: What is an HTC File?Did you find an HTC file on your computer and wonder what program should open it? Maybe someone emailed you an HTC file but you're not sure how to use it. Perhaps you tried to open the HTC file but Windows told you that it could not open it. Before you can open an HTC file (assuming it's even a file format that's intended to be viewed or edited), you'll need to determine what kind of file the HTC file extension refers to. Answer: A file with the HTC file exte...

   HTC,HTML Component,JavaScript,Extension     2011-06-30 23:07:44

  4 asynchronous programming methods in JavaScript

You may know the execution environment of JavaScript is single threaded. The so called single thread means only one task can be running at any time, if there are many tasks, they need to be in a queue and wait for the previous task to be completed. The advantage of this mode is it's easy to implement and the execution environment is relative simple; the disadvantage is that if one task takes long time, the tasks following it must wait in the queue and this will delay other tasks consequently. Th...

   JAVASCRIPT,ASYNCHRONOUS PROGRAMMING, EVENT MODEL,PROMISE     2012-12-25 00:55:47

  IDEs for Java programmers

IDEs are great helpers to programmers. They can help programmers write less error-prone programs with less time. They have become an inevitable part of many programmers. As a Java developer, you may be familiar with Eclipse already. But do you know other IDEs for Java programmers? We will give an overview of different IDEs for Java programmers. These IDEs are Eclipse, Intellij IDEA, NetBean and BlueJ. Eclipse Eclipse is the most widely used IDE for Java programmers. It's an open source IDE whic...

   Java IDE,BlueJ,NetBeans,Eclipse     2014-08-21 06:15:54

  JavaScript to open link in new window without being popup blocked

To ensure security and reduce spamming, modern browsers have implemented very strict rules on when a new window can be opened in a web page. Currently browsers restrict that any new web page to be opened in a new window must be initiated with an user action. The action is usually an user click event. Otherwise, a popup blocker would show on the browser address bar which indicates that something is blocked. To workaround this issue, normally you should implement the window open logic in a click e...

   JAVASCRIPT,IFRAME,NEW WINDOW,OPEN LINK     2018-09-22 04:29:30