<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Mobile-Web-App: Javascript Exercise - String, indexOf() and charAt()</title>
<script>
function test(){
var s = 'Mobile-web-App';
info = "<p>s = 'Mobile-web-App'</p>"
+ "<p> s.indexOf('-') " + s.indexOf('-') + "</p>"
+ "<p> s.indexOf('-A') " + s.indexOf('-A') + "</p>"
+ "<p> s.indexOf('x') " + s.indexOf('x') + "</p>"
+ "<p> s.chartAt(0) = " + s.charAt(0) + "</p>"
+ "<p> s.chartAt('3') = " + s.charAt('3') + "</p>"
+ "<p> s.chartAt(-1) = " + s.charAt(-1) + "</p>"
+ "<p> s.chartAt(20) = " + s.charAt(20) + "</p>";
document.getElementById("prompt").innerHTML=info;
}
</script>
</head>
<body onload="test();">
<h1>Mobile-Web-App: Javascript Exercise - String, indexOf() and charAt()</h1>
<div id="prompt"></div>
</body>
</html>
Saturday, April 21, 2012
Javascript Exercise - String, indexOf() and charAt()
Javascript Exercise - number arithmetic, toFixed() and toPrecision()
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Mobile-Web-App: Javascript Exercise - number arithmetic, toFixed() and toPrecision()</title>
<script>
function test(){
var a = 10.1;
var b = 10.2;
var c = a + b;
info = "<p>a = 10.1, b = 10.2, c = a + b</p>"
+ "<p> a + b = " + (a + b) + "</p>"
+ "<p> c = " + c + "</p>"
+ "<p> c.toFixed(2) = " + c.toFixed(2) + "</p>"
+ "<p> c.toPrecision(8) = " + c.toPrecision(8) + "</p>";
document.getElementById("prompt").innerHTML=info;
}
</script>
</head>
<body onload="test();">
<h1>Mobile-Web-App: Javascript Exercise - number arithmetic, toFixed() and toPrecision()</h1>
<div id="prompt"></div>
</body>
</html>
Data type of Javascript: string and number
This exercise, the function typeof() is used to test the data type of various string and number object.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Mobile-Web-App: Javascript Exercise - data type</title>
<script>
function test(){
info = "<p>typeof \"\": " + typeof("") + "</p>"
+ "<p>typeof 'a': " + typeof('a') + "</p>"
+ "<p>typeof \"a\": " + typeof("a") + "</p>"
+ "<p>typeof 'abc': " + typeof('abc') + "</p>"
+ "<p>typeof \"abc\": " + typeof("abc") + "</p>"
+ "<p>typeof 0: " + typeof(0) + "</p>"
+ "<p>typeof 1: " + typeof(1) + "</p>"
+ "<p>typeof 1.0: " + typeof(1.0) + "</p>"
+ "<p>typeof 1.5: " + typeof(1.5) + "</p>"
+ "<p>typeof null: " + typeof(null) + "</p>";
document.getElementById("prompt").innerHTML=info;
}
</script>
</head>
<body onload="test();">
<h1>Mobile-Web-App: Javascript Exercise - data type</h1>
<div id="prompt"></div>
</body>
</html>
Friday, April 20, 2012
The D Programming Language
The D Programming Language combines modeling power, modern convenience, and native efficiency into one powerful language. D embodies many new ideas in programming languages along with traditional proven techniques.
Google JavaScript Style Guide
JavaScript is the main client-side scripting language used by many of Google's open-source projects. The on-line style guide, Google JavaScript Style Guide, is a list of dos and don'ts for JavaScript programs.
Link: http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml
Link: http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml
Check Browser Compatibility at quirksmode.org
QuirksMode.org is the prime source for browser compatibility information on the Internet. It is maintained by Peter-Paul Koch, mobile platform strategist in Amsterdam, the Netherlands.
QuirksMode.org is the home of the Browser Compatibility Tables, where you’ll find hype-free assessments of the major browsers’ CSS and JavaScript capabilities, as well as their adherence to the W3C standards.
It is also increasingly the home of ground-breaking mobile web research.
QuirksMode.org is the home of the Browser Compatibility Tables, where you’ll find hype-free assessments of the major browsers’ CSS and JavaScript capabilities, as well as their adherence to the W3C standards.
It is also increasingly the home of ground-breaking mobile web research.
Wednesday, April 18, 2012
ThemeRoller for jQuery Mobile
The ThemeRoller Mobile tool makes it easy to create custom-designed themes for your mobile site or app. Just pick colors, then share your theme URL, or download the theme and drop it into your site.
Try it: http://jquerymobile.com/themeroller/
Try it: http://jquerymobile.com/themeroller/
Subscribe to:
Posts (Atom)




