(Updated: 1999.07.22 08:33:08 AM)
| |
Table of Contents
- Get Two Comments for the Price of One
- Optional Cookies
Get Two Comments for the Price of One: If you're writing code to send HTML to the Response object, instead of putting
VFP comments in your code, put
HTML comments. Now, you see the same comment whether reviewing the code, or viewing the HTML source in the browser--very helpful sometimes.
You can even add a function to your own subclass of the wwHTML
Frame Work class. Example:
FUNCTION WriteComment( lcComment )
THIS.Send( [<] + [!-- ] + lcComment + [--] + [>] + CR )
ENDFUNC
Call it in your code like,
Response.WriteComment( "Nested table for formatting purposes."). --
Randy Pearson
Optional Cookies: If your application doesn't
require cookies, but you want to provide features to users who will accept cookies, try this approach. Put a link on your top page called "Remember Me". If the user clicks the link, send them a cookie and add a record for them to your cookie table. On all incoming hits check if a cookie exists and save the value to a property. Now, on pages where you want to provide options, you can check if any user-specific settings exist. The benefit here is that the user chooses whether or not to accept the cookie--you're not just feeding the user :). --
Randy Pearson
Category Web Tools