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

SEARCH KEYWORD -- javascript



  About browser event

First look at following codes: var $ = KISSY.all; $(‘a’).on(‘click’,function(e){ doSomeThing();//This function seems very famous e.halt(); }); The above codes seem complete the work we want them. The browser will not redirect us to the link in href, but is there some issue with the codes above? Before explaining what's wrong with the above codes, we first need to understand some concepts. Browser default behavior When we click a link, the browser will redirect us to anoth...

   JavaScript event,Event bubbling,event capturing     2012-11-15 11:15:41

  JavaScript delete specific item from array

Deleting an item from an array is easy using JavaScript’s built-in method splice(). However, if you are somewhat new to scripting, simply knowing about splice does not help you remove a certain item from an array. This article will solidly state the solution to this dilemma.If you want to remove a specific item from your array, you will simply use a basic loop and a conditional check with the splice()method.Here is a breakdown of what we will do in 3 easy steps, so tha...

   JavaScript,Array,Remove item,Splice,Dele     2011-09-16 16:38:52

  Dart is to JavaScript as C# is to C++

Given the background of Lars Bak, the Google engineer whose V8 JavaScript interpreter upended Firefox's claim on speed, it was reasonable to suspect Google's new Web development language might look a lot like Smalltalk. But that might have taken the Web in a strange and different direction. Today, on the day of a Web developers' conference in Denmark, Google and members of the Chromium open source development team raised the curtain on Dart, the company's bid for a new and somewhat more str...

   Dart,Google,JavaScript,Virtual Machine,Chromium     2011-10-21 08:40:09

  Load html content properly in iframe

When loading content in an ifrasme, there are normally two ways: loading with src or creating iframe dynamically and set content dynamically. In this post, we will talk about how to properly load content in a dynamically created iframe element, especially on how to fix some issue we faced while in Firefox. To create an iframe dynamically, we would normally use JavaScript and with below piece of cod: let iframe = document.createElement("ifrasme"); iframe.innerHTML = "this is some text"; document...

   IFRAME,HTML,BLANK,FIREFOX,FIX     2021-04-10 02:17:27

  Why localStorage only allows to store string values

localStorage allows data to be stored in browsers across sessions, the data will be there even though the session is expired. It is frequently used to store static data so that they can be loaded when needed. But as per spec, it says that the keys and the values are always strings (note that, as with objects, integer keys will be automatically converted to strings). Why cannot store the object as it is? Take a look at an example: var str = "test"; localStorage.setItem("str", str); cons...

   JAVASCRIPT,LOCALSTORAGE     2020-04-05 00:54:29

  Simple Animation in the HTML5 Canvas Element

HTML5 is generating all kinds of buzz these days. Some of the buzz is about HTML5 being a replacement for Adobe’s Flash. I don’t think it’s there yet but it’s certainly on the way to changing the way content is presented on the web. This is a description of a very simple animation in an HTML5 canvas element. It is coded for readability and not for optimized operation. We’ll add a canvas element to a web page and then use javascript to draw on it. We will...

   HTML5,Canvas,Animation,Sample code     2011-07-01 10:20:08

  Want to be a Java developer?

Java is one of the top 3 programming languages in the world. It can be used to develop both web applications and desktop applications and more importantly it is cross platform--write once, run everywhere. Also, it's easy to pick up. If you want to be a Java developer, please get to ask yourself whether you know below listed topics. This list is summarized by Vivek Vermani, a Senior Java Developer: For a Core Java Developer , Ffollowing topics should be good. OOPs Concepts Abstract Classes and I...

   Java,developer,resource     2014-06-19 06:18:47

  18 Good Web and Mobile Development Frameworks

iWebKitjQTouchjQuery MobileSencha TouchWijmo – jQuery UI WidgetsThe-M-Project – HTML5 Javascript FrameworkTreesaver.js – Framework for Creating Magazine-Style LayoutsjQuery Form Framework – jFormerNot Just A Grid – Flexible and Modular CSS FrameworkZepto.js – Minimalist JavaScript Framework for MobileGalleria – JavaScript Image Gallery FrameworkGury – HTML5 Canvas Utility LibraryAmplifyMobl – Open-Source HTML5-Based LanguageSproutCor...

   Web,Mobile,Android,iPhone,WP7,jQuery     2011-04-14 02:45:35

  JavaScript cross domain request solution

1. What is cross domain? We may often using AJAX to request data from other domain, now we will have cross domain request issues. It's because JavaScript only allows to request data from the same domain because of security consideration. In short, same domain strategy means a piece of code can read data from the same source, the same source here means the combination of the same domain, protocol and port number. For example: URLDescriptionAllow communication? http://www.a.com/a.js http:/...

   AJAX,cross domain,security     2013-03-13 20:04:52

  Some hidden XSS injection vulnerabilities

XSS injection refers to a Web page generates some unexpected executable js codes based on user input  and these executable codes are executed by web browser,i.e, the source code sent to web browser by the server contains some illegal js codes, and these illegal js codes are related to user's input. Common XSS injection vulnerabilities can be fixed with some functions such as htmlspecialchars(escaping HTML special characters) and strip_tags() or similar, but there are some hidden XSS injecti...

   XSS,PHP,Security,Code,JavaScript     2012-08-27 20:32:08