|
NoScript alternatives for Javascript content using CSS visibilty |
2.interactiveMap {visibility: hidden;}
2 // show the map
3 document.getElementById('interactiveMap').style.visibility = "visible";
4</s/cript>
2<p></p>
3
4<!--- get the regions list --->
5<cfset variables.regions = getRegions()>
6
7<ul>
8<cfloop query="variables.regions">
9<li><a href="region.cfm?region=#variables.regions. regionid#">#variables.regionName#</a></li>
10</cfloop>
11
12</ul>
13</noscript>
|
Passing url variables through Isapi re write - Regular Expression |
One of the more common tasks in ColdFusion development is passing variables through the URL string. We are all familiar with the idea that the question mark (?) denotes the url query string start, and that name value pairs are separated with the ampersand (&).
I usually avoid using this in display templates, as it isn't great exposing your internal site workings to customers, and with Fusebox it is very easy to pass the URL variables to an "act_" template and remain hidden.
What happens when you want to use dynamic url variables with a URL re writing application like Isapi re write? I've been using Isapi re write in some FuseBox framework application, and it is relatively easy to set up a rewrite rule, as shown below.
Where the url /home/ would actually serve up the content specified in the fuse specified. But this is hard coded. What about dynamic variables?
We can create a regular expression to handle the translation of the variables.
We use a similar URL, but append the dollar ($) 1 = dollar ($) 2 string. In the re write rule we specify that appended variables are transposed into the string using the slash (/) as a separator.
So as an example we could pass a product id of 24 into the rule like this:
2RewriteRule buy/(.*)/(.*)/ index.cfm?go=cart.buy&$1=$2
It would be rewritten to the more familiar url string. A handy way of continuing to mask the url.
|
Strict or Transitional DTD type validation, worth hacking just to pass? |
An area of web development that I previously had little exposure to was WCAG validation. This is the industry standard for Accessibility coding for web platforms. For version two (V2) of the WCAG there are three standards, A, AA and triple A (AAA). Each represents different levels of Accessible compatibility.
What this also does is validate against the W3C doctype standards. This is where my problems arose. The main aim of the doctype standard is to clearly define a separation layer between content and behaviour. In practical terms this equates to best practices such as having an external .CSS files rather than inline styling, and declaring the language types for scripting, such as JavaScript etc.
Using a free online tool, http://www.totalvalidator.com/ you can check if your site is W3C and WCAG complaint. It will base the validation on the doctype declared in your html. There are three types of DTD declaration for html 4.01.
2
3<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4
5<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/frameset.dtd">
You can read more about Doctypes here: http://www.w3schools.com/tags/tag_DOCTYPE.asp
The main difference between these is that the frameset DTD will accept frameset as valid html, whereas the others will not. Also the Strict DTD imposes a very tight restriction of what is accepted as valid in comparison to the Transitional DTD. One is a Strict adherance to the standard, whereas the other shows that you are Transitioning from old code into the new.
The site http://24ways.org/2005/transitional-vs-strict-markup goes into more detail about what the exact differences are, what I am going to discuss is the option of creating functional hacks, merely to pass validation.
One of the deprecated attributes in Strict validation is the target attribute.
We are all familiar with this attribute, but when you examine it you find that it is actually a declaration of behaviour. We are forcing the user into a specific action. IE open a new window. As a best practice guideline whenever we have a link on a site that exits that site, we open a new window. The only work around for this is creating a specific JavaScript function to open a new window, as this will not be marked as invalid. This seems overkill, just to pass validation.
So I am left with the dilemma that if I want my sites to pass Strict DTD validation I must create a JavaScript hack, or compromise the functionality. I'd like to pass the validation, but I view the functionality as key to a site, so it's an easy decision for me.
|
Internet dating disasters site - Online fraud and security |
A popular daytime television show in the UK has recently broadcast an article on Internet security and Internet dating. With Online Dating being an industry I worked in for a brief period this was quite relevant to me.
http://www.itv.com/lifestyle/thismorning/more/internetdatingdisasters/
The main aim of the Sally Cornock's site is to warn of 'love rats' and suspicious profiles online. It appears that she was stung by a serial dater online and has done something about it.
It highlights the dilemma of free to join, fixed cost membership sites quite well though. Most dating sites are free to join. They provide very little functionality, and no interaction at all with other members UNLESS you upgrade your account and pay a fee. When you understand this it makes policing this near on impossible.
Sally Cornock has raised the issue of potentially having a governing body to perform validation on members as they join, so that you know someone is who they say they are. This would discourage a massive percentage of the market, as signing up for free by providing only one or two fields of data is simple. But passing an online verification is an extra level of hassle to the "casual shopper", which most people are. When you look at the statistics only a tiny number of signups ever convert to full membership.
It nicely highlights some of the less technical aspects of web usage, click through below to read more:
http://www.suzylamplugh.org/personal-safety/personal-safety-tips/safety-on-the-internet/