Using HTML Kit to Debug Server-Side Scripts

Similar documents
Improved Web Development using HTML-Kit

Lies, Damned Lies, Statistics and SQL

Instructor s Notes Web Data Management Web Client/Server Concepts. Web Data Management Web Client/Server Concepts

Dreamweaver is a full-featured Web application

Dreamweaver is a full-featured Web application

Dreamweaver MX The Basics

When you don t want to lose your site s existing look and feel, you re

Using Dreamweaver. 1 Overview. About the Web. About Dreamweaver

Browsing the World Wide Web with Firefox

Site Owners: Cascade Basics. May 2017

121 Access to MySQL Tutorial

TectiteFormmail in WebPlus

Web Server Setup Guide

1. Please, please, please look at the style sheets job aid that I sent to you some time ago in conjunction with this document.

Life, the Universe, and CSS Tests XML Prague 2018

c122jan2714.notebook January 27, 2014

Part A: Getting started 1. Open the <oxygen/> editor (with a blue icon, not the author mode with a red icon).

Introduction to Internet Applications

The FileSystemObject Object. Active Server Pages

CSCU9B2 Practical 1: Introduction to HTML 5

Introduction to Cascade Server (web content management system) Logging in to Cascade Server Remember me Messages Dashboard Home

Table of contents. DMXzone Nivo Slider 3 DMXzone

FrontPage Help Center. Topic: FrontPage Basics

Who should use this manual. Signing into WordPress

E-Business Systems 1 INTE2047 Lab Exercises. Lab 5 Valid HTML, Home Page & Editor Tables

Adding Pages. Adding pages to your website is simple and powerful! In just a few minutes you can create a page that: Highlights a special event

The World Wide Web is a technology beast. If you have read this book s

Java Help Files. by Peter Lavin. May 22, 2004

Zend Studio has the reputation of being one of the most mature and powerful

Browser Configuration Reference

Client Side JavaScript and AJAX

avenue.quark TUTORIAL

ENCM 339 Fall 2017: Editing and Running Programs in the Lab

Quality Assurance & Accessibility

HTML/CSS Lesson Plans

Getting Started. Excerpted from Hello World! Computer Programming for Kids and Other Beginners

CSCI 201 Lab 1 Environment Setup

How to Install (then Test) the NetBeans Bundle

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

Computer Networks - A Simple HTTP proxy -

COMS 359: Interactive Media

If you re the administrator on any network,

Authoring World Wide Web Pages with Dreamweaver

Techniques for Optimizing Reusable Content in LibGuides

TechNote: 5a-WordPress Install - PHP 5-2-x Setup

Castaway. Latest version of this document:

How to use the Assets panel

Accessibility of EPiServer s Sample Templates

RAGE WebDesign Quick Start 1 of 18. Welcome To RAGE WebDesign

Starting to Program in C++ (Basics & I/O)

Using the wiki activity in Moodle

Using htmlarea & a Database to Maintain Content on a Website

Table of Contents. 1. Installation 3 2. Configuration 4 3. How to create a custom links 9 4. More Information 11

Developing Online Databases and Serving Biological Research Data

Adding Pages. Adding pages to your website is simple and powerful! In just a few minutes you can create a page that: Highlights a special event

Things to note: Each week Xampp will need to be installed. Xampp is Windows software, similar software is available for Mac, called Mamp.

Using Tab Stops in Microsoft Word

CSE 115. Introduction to Computer Science I

In this exercise you will display the Geo-tagged Wikipedia Articles Fusion Table in Google Maps.

HTML4 TUTORIAL PART 2

Content Publisher User Guide

Setting Up the Development Environment

One of the hardest things you have to do is to keep track of three kinds of commands when writing and running computer programs. Those commands are:

Website Updates Made Easy

CICT UniMAP USER MANUAL JOOMLA 2.5

Editing and creating new pages and posts in WordPress

c122mar413.notebook March 06, 2013

Guidelines for work on the Genebank KB site

Collection Information Menu. Navigation, pages, and related-links quickstart guide

In!order!to!enable!this!functionality,!three!files!must!be!employed!on!the!webserver:!

Testing the Unit Test Plan for the Media Manager

Table of contents. Pure ASP Upload 3 Manual DMXzone

Working with Windows Movie Maker

Tutorial Tutorial. (Click here to go to the next slide and to learn more)

Using the Computer Programming Environment

PROFESSIONAL TUTORIAL. Trinity Innovations 2010 All Rights Reserved.

Hello World! Computer Programming for Kids and Other Beginners. Chapter 1. by Warren Sande and Carter Sande. Copyright 2009 Manning Publications

Dreamweaver 101. Here s the desktop icon for Dreamweaver CS5: Click it open. From the top menu options, choose Site and New Site

Hello Button. An Introduction to Tcl/Tk

Get Started in 10 Simple Steps

WORKING WITH TEMPLATES

User Guide for ID-e Tag List Feature

Java WYSIWYG Editor Info

3I installation on Windows XP Proffessional. D. Dmitriev, (Last updated October 28, 2008)

From administrivia to what really matters

9+2 Often-Overlooked Features In Flare s Target Editor

Reading How the Web Works

Installing Joomla

How to Make Your Content ADA Compliant

Creating a multilingual site in WebPlus

CREATING WEBSITES. What you need to build a website Part One The Basics. Chas Large. Welcome one and all

USER GUIDE MADCAP FLARE Accessibility

Notetaking with ReStrutcturedText

Section 1. How to use Brackets to develop JavaScript applications

Take Command Configuring pppd in Linux, Part II

Blogging at

This document provides a concise, introductory lesson in HTML formatting.

Introduction, Notepad++, File Structure, 9 Tags, Hyperlinks 1

Unifer Documentation. Release V1.0. Matthew S

WPI Project Center WordPress Manual For Editors

Transcription:

Using HTML Kit to Debug Server-Side Scripts by Peter Lavin April 21, 2004

Overview Browsers are notorious for rendering HTML pages perfectly even when a page contains errors. For instance, a button may display properly but not function because of a missing closing tag. Hence the need for tools to check syntax. This is relatively straightforward for static HTML pages but what about dynamic pages? When server-side technologies such as PHP or ASP are used to create HTML pages dynamically, checking and debugging the result can be difficult. This article will show how this can be done using the free text editor, HTML-Kit. This will involve configuring some of the features of this editor. No knowledge of any specific technologies is required but a general knowledge of HTML and of the function of browsers and web servers is assumed. Preview Files in HTML-Kit Page 1

Introduction I do not intend to repeat anything covered in my introductory article on HTML-Kit except to note a few features that directly relate to the current discussion. What I intend to do here is explain some of the ways this application may be used to simplify the writing, validation and debugging of server-side scripts. If you need to download and install HTML-Kit please see the instructions at http://www.chami.com/htmlkit/. To check your server-side scripts - and it is always good practice to check them locally before uploading them - you need a server. Since HTML-Kit only runs under Windows you will most likely be using Personal Web Server (PWS) or Internet Information Server (IIS). All versions of Windows after Windows 95, excepting ME, support running these web servers locally. If you are adventurous and have Installed Apache Web Server under Windows this will also work and you should be able to follow along making the appropriate changes. Naturally enough, all versions of PWS and IIS support server-side scripting using ASP but, as mentioned above, what s detailed here applies to any server-side script supported by your server. Getting Started Since your files will be processed by a web server make sure that you are working in a directory located in the home directory of your server. If you are using IIS or PWS then this is most likely C:\Inetpub\wwwroot\. As long as your directory is under the root directory of your server you do not need to turn on web sharing. However, it is not a bad idea to do so. This can be done through IIS or PWS server administration or simply by right clicking the appropriate directory and choosing the menu option Properties and then the Web Sharing tab. If there is no Web Sharing tab then make sure that your server is installed and is running. Configuring HTML-Kit In order to use this HTML editor to debug server-side scripts we need to edit the user preferences. This can be rather intimidating as there are over twenty tabs in the configuration window and many options on each page. Have a look. Press the Edit menu option and then, at the very bottom, choose Preferences. You should find a screen similar to the one below. Preview Files in HTML-Kit Page 2

In this article we will only be dealing with a very limited number of settings. These will be, firstly, some basic settings to increase usability, secondly, telling HTML- Kit where your server is located and finally, making file associations. Basics Something that you might want to pay immediate attention to is the file format setting on the Save tab of the preferences window. If you know that the server you are planning to upload your files to runs on a Linux or Unix platform then be sure to choose the Unix file format. The reason for this is that different operating systems handle the return key in different ways. If you save your files in Windows format and later download them from a Unix server you will find that an extra carriage return has been inserted after each line. While this does not change your file s functionality it can be annoying. As an additional note, having saved your HTML file in Unix format, it will not display properly in Notepad. If you want to view it in a Windows text editor use WordPad instead. If you do save it from WordPad make sure you save it in text format. I ll just point out that you can quickly access commonly performed tasks by adding them to Favorites. If you right click a button on any one of the elements in the Actions Bar (the tabbed strip below the tool bar) a pop-up menu allows you to add this item to your favourites. When you become familiar with HTML-Kit and find that you repeatedly use certain capabilities you will really appreciate this feature. Preview Files in HTML-Kit Page 3

Exploring the other settings will certainly improve your efficiency with this tool but these are really the only settings you may need to worry about here. Set Up the Server Html-Kit needs to know where your server is located if it is going to process your server-side scripts. Again, this is configured from the Preferences menu option so open the preferences window and choose the Preview tab. In the frame entitled Preview Rules make sure that the Enable Server Mappings box is checked. Having done that, click the Edit Preview Rules button. Here you will add a server mapping. Clicking the Add button will open a dialogue window and you will be able to add a File Path and a server address. If you are running IIS or PWS on your local machine the file path will be C:\Inetpub\wwwroot\. For the server address put http://<your computer name>/ substituting the appropriate value for your computer name or, if you like, you may use localhost. Make sure you click Okay to save your preferences. Now, whenever you preview files that are in a directory at or below the root directory of your server, they will be processed by your server. If your server-side script generates HTML the server will create it when you preview a file. File Associations From the preferences window choose the Programs tab. In the Windows Integration frame click the button with the caption File Associations, Explorer. For the Internet Explorer (IE) 5+ Integration option make sure that the Use to View Source box is checked. This will ensure that when we preview a file in HTML-Kit and then choose to view the source code of a page it will also be shown in HTML-Kit. Since we ve already told HTML Kit to run this file through our local server, any server-side scripting will have been processed and output as HTML. View Source and Validate As mentioned in my earlier article, one of the nicest features of HTML-Kit is the ability to preview your files. This capability is central to the current discussion. Briefly, to preview the current file all you need to do is click the Preview tab at the bottom of the Editing Window. The application defaults to showing how your page will look in Internet Explorer. Having configured HTML-Kit, we can now deal with the problem of validating files that need to be processed by the server. Open any file that dynamically generates HTML and then press the Preview tab. When your processed page Preview Files in HTML-Kit Page 4

shows, right click the preview window, avoiding any graphics, and then choose View Source from the pop-up menu. Doing this will open another window in HTML-Kit, a window that holds the HTML code as generated by your server. A word of warning make sure that you are previewing in Explorer Mode and not Gecko Mode. The preferences menu only allows you to view the source in Internet Explorer. If you are in Gecko mode this option will be disabled. If your file has been properly processed by the server you are now in a position to verify your dynamically created web page. HTML-Kit has the capability of checking HTML code by uploading it to an online mark-up validation service. By choosing the menu options Actions and then Online you will have two choices for validating your HTML file. You may use the Web Design Group (WDG) or the World Wide Web Consortium (W3C) validator. I prefer to use the W3C validator because this is the organisation responsible for developing guidelines and standards for the web. Whichever service you choose, your file will be uploaded and a report generated. Any coding errors that exist will be referenced by line number. You can even print out your code with all the errors referenced. The W3C service will also inform you of any deviations from the standard - if you are missing the alt attribute from an img tag for instance. While these errors will not affect the functionality of your page, why not write code to conform to the standard? It will certainly improve the interoperability of your page and make it more user friendly. Conclusion Through a few rather simple steps HTML-Kit can be set up to validate HTML code generated by a server-side script. Dynamically created pages may be viewed in HTML-Kit and the resultant HTML page uploaded to a validation service to check its syntax. All this functionality integrated into one tool makes it an easy way to debug server-side scripts. About the Author Peter Lavin runs a Web Design/Development firm in Toronto, Canada. For more information visit http://www.softcoded.com/. He may be reached at peterlavin@sympatico.ca. Preview Files in HTML-Kit Page 5