Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Opa Application Development

You're reading from   Opa Application Development A rapid and secure web development framework to develop web applications quickly and easily in Opa

Arrow left icon
Product type Paperback
Published in Jun 2013
Publisher Packt
ISBN-13 9781782163749
Length 116 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Li Wenbo Li Wenbo
Author Profile Icon Li Wenbo
Li Wenbo
Arrow right icon
View More author details
Toc

Preparing pages


We have discussed how to launch the server and dispatch users' requests. Now it is time for the frontend issue, namely, the web page. Web pages are what users see and interact with. There are numerous technologies that can be used for building excellent web pages, such as PHP, Perl, and Python. But the basic way is using HTML and CSS.

XHTML

In Opa, both HTML and CSS are first class citizens, and are understood and checked by the compiler without you having to wrap them as strings. Having XHTML as a native type implies near-perfect XSS (cross-site scripting) protection. It also means we can easily compose elements, that is, we can write <div>{foo()}</div>. HTML values have a predefined xhtml type, and there is a built-in syntax for constructing XHTML values. Here is an overview of the syntax for XHTML:

// XHTML is a data-type with built-in syntax
xhtml span = <span class="test">Hello Opa!</span>
//named closing tag is optional,
// so are the quotes around...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image