web app

Scala.js tutorial: How to start building single-page web applications

Table of Contents1 - Single-page applications2 - 1. Getting started (dependencies)3 - 2. Create hello3.html4 - 3. Create Hello3.scala5 - 4. Run the code!6 - Summary/Discussion7 - Resources8 - More facades9 - Other tutorials in this series10 - Bonus!11 - Source code

In this final, third part of my three-part introductory series on Scala.js I’ll demonstrate a technique that can help you build single-page web applications with Scala.js. That is, the body of your HTML page will look like this:

<body>
    <div id="root"></div>          

    <script type="text/javascript" src="./target/scala-2.12/scala-js-hello-world-jsdeps.js"></script>
    <script type="text/javascript" src="./target/scala-2.12/scala-js-hello-world-fastopt.js"></script>
</body>

After that, your entire application will then be written in Scala/Scala.js, which is converted into JavaScript code in the scala-js-hello-world-fastopt.js file.

iPhone user agent - Use JavaScript to detect the user agent

iPhone 'user agent' FAQ: I'm trying to optimize my HTML/web app for the iPhone; how do I detect an iPhone, iPod, or iPad browser in my web application?

This Apple page shows the iPhone, iPod, and iPad user agent strings, so you just need to write some JavaScript that properly parses those iPhone/iPad browser user agent strings.

Setting an iPhone HTML/web app icon | iPhone app home screen icon

iPhone HTML app icon FAQ: I'm creating an iPhone HTML web app, and I want users to be able to save my HTML app icon to their iPhone home screen; how can I add a custom iPhone app icon to my web application?

The iPhone Mobile Safari web browser recognizes a special HTML tag that lets you add an iPhone app icon to your HTML application. Here's the syntax that lets you add an iPhone app icon to your web app:

iPhone HTML apps - Status bar control (color control)

iPhone HTML apps status bar FAQ: When creating an iPhone web app so it looks more like a native iPhone app, how can I control the iPhone status bar color?

Once you've removed the iPhone Safari browser URL bar, the next thing you can do to make your HTML web app look more like a native iPhone app is to control the iPhone status bar. The status bar is the bar at the top of the iPhone screen.

iPhone HTML app full screen mode - How to remove the URL and button bars

iPhone HTML web app FAQ: In an HTML web app optimized for the iPhone, how do I remove the URL bar on top of the iPhone Mobile Safari web browser so I can show my HTML app in full screen mode?

When you're creating an HTML/web app to look like a native iPhone app, one of the things you'll want to do is remove the URL bar in the Mobile Safari web browser. This is the URL bar on the top of the iPhone browser, and by getting rid of it, you can display your web app on the iPhone in full-screen mode.

Setting iPhone HTML app page width/size (pixel width)

iPhone HTML page size FAQ: In an HTML web app optimized for the iPhone, how do I set the page size to be the optimal iPhone page size (iPhone page pixel width)?

By default the iPhone assumes HTML pages are 980 pixels wide. When you're creating a custom iPhone HTML app, you really want to control this page size so your web app will look better.

The way you change the iPhone HTML page size (pixel width) is to use the special iPhone HTML "viewport" meta tag, like this:

How to load multiple Spring application context files for a web application

Here's an example web.xml configuration file where I show how to configure the Spring Framework to properly load for a Java web application. I'm intentionally trying to keep this Spring example simple, so my web.xml file has almost the bare minimum configuration.

I show how to load the Spring ContextLoaderListener class with the listener-class tag, and also show how to load multiple Spring application context files using the context-param, param-name, and param-value XML tags.

Ant WAR task - A sample Ant build script that builds a WAR file

You'll probably have to know a little bit about Java, Ant, and build files for this sample build.xml file to be any use to you, but if you're looking for a sample Ant build script that can be used to create a war file, or one that simple uses a war task, this example might work for you.

I'm not going to provide any explanation of any of this right now, but if I have time in the future I'll come back here and add a few comments about how this build script works.