Posts

Showing posts with the label HTML5

Using the Same Language for Microservices, iOS Apps, and Browser / Web Apps

Image
You're looking for the appropriate language?  Kotlin  might be the language you're looking for! Here you can find some sample projects that show how it can actually be done: Sample iOS app, written in Kotlin, using Maven or Gradle for building   —  this is how it looks Browser app that shows how Kotlin can access HTML's DOM  — this is  how it looks Browser app written in Kotlin that uses HTML5' Canvas  — this is  how it looks Another Browser app that shows how Kotlin can be used to build HTML5 apps   — this is  how it looks …all projects should work out-of-the-box.

Kotlin/JavaScript HTML5 Canvas Example

Image
This is the  source for a simple Kotlin (JavaScript) HTML5 Canvas app  that lets one type a random series of letters. And this is  how it looks like .

Kotlin/JavaScript HTML5 Example for DOM Manipulation

Image
I just published a simple  Kotlin/JavaScript "getting started app"  that  shows the Unicode characters for a specific decimal range. And  this is how it looks like .

Client-side Facebook Access Token Retrieval

Image
Save this HTML5 app as facebook-accessToken.html: <!DOCTYPE html > < div id= "fb-root" ></ div > < div class= "facebook" > Log in with Facebook </ div > < script src= "// code.jquery.com/jquery-2.1.0.min.js " ></ script > < script > $ ( document ). ready ( function () { ( function (d, s, id) { var js , fjs = d. getElementsByTagName (s)[ 0 ]; if (d. getElementById (id)) return ; js = d. createElement (s); js . id = id; js . src = "// connect.facebook.net/en_US/sdk.js " ; fjs . parentNode . insertBefore ( js , fjs ); } ( document , 'script' , 'facebook-jssdk' )); window . fbAsyncInit = function () { FB. init ( { appId : ' App ID, e.g. 2496324382648314, ' + 'can be retrieved from ...

Remote host browser policy for local HTML5 development

Use the domain  local.loxal.net  if you want to access your  localhost  applying  remote host execution policy  of your browsers JavaScrip virtual machine. Also some HTML5 APIs are only usable when you call them from a remote hostname. To verify that everything works correctly, just execute  ping  local.loxal.net   which should execute pings against your  127.0.0.1 IP address , aka  localhost . idea:~/my/project/loxal/Vel master  ping  local.loxal.net PING localhost (127.0.0.1): 56 data bytes 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.082 ms 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.127 ms 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.128 ms

E-mail address regex / regexp pattern

The whole  e-mail address  regexp pattern thing is  much  more complex than just a .*@.*  and there are  a lot  of different variations. However this one is the  HTML5 spec regex pattern : /^[a-zA-Z0-9.!#$%&amp;'*+/=?\^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/ ...as of 2012-01-10. It works well together with RequestFactory's onConstraintViolation. @Pattern( message = "Invalid mail address.", regexp = "^[a-zA-Z0-9.!#$%&amp;'*+/=?\\^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$" ) private String mail;

Actual facts about Google Dart / Dash

There is much FUD on the web about Google's new "structural programming language" called Dash/Dart. Actually it is called " Dart " and there is an official internal introduction mail that has been leaked by Google. In this mail you can read what Dart actually is ( and what it is not : "A JavaScript killer!" ) and how Google intends to incorporate existing technologies like Closure, GWT, JS++, Joy, JSPrime, JSCompiler and last but not least, JavaScript itself in Dart . Also you can read about Dart's relation to Android and Go. Here is a copy of the above mentioned mail: ---------- Forwarded message ---------- From: Mark S. Miller Date: Tue, Nov 16, 2010 at 3:44 PM Subject: "Future of Javascript" doc from our internal "JavaScript Summit" last week To: java...@google.com On November 10th and 11th, a number of Google teams representing a variety of viewpoints on client-side languages met to agree on a common vision for the fut...

HTML5: The body element is optional

You can omit the <body> and even the <html> element itself in HTML5. However if you want to use <body>'s  onload  event, you can replace it by  window's onload event  and assign the JavaScript function you want to call (when the document is loaded) as stated below:  window.onload = function() { /* anonymous function directives */ };