18 May 2007
As the number of SWFAddress powered sites grows I often see problems caused by poor implementations or lack of information. Here is a list of the top 5 practices which should be avoided:
- Usage of getURL() for user tracking, statistics and popups
- Homepage address values like '#Home' or '#/root'
- Such address values are not needed and should be replaced by SWFAddress.setValue('/'). The usage of http://domain.com/#home creates an unneeded history entry when http://domain.com is opened.
- Address values naming using camelCase or other forms of custom convention
- SWFAddress samples clearly define the best naming convention for deep links. Web addresses are case insensitive and the standard is lower case. For readability and Google SEO compatibility reasons the convention 'my-deep-link' is more appropriate than 'myDeepLink' or 'My_deep_link'. The format http://domain.com/#/my-deep-link/?param=value is the only one fully compatible with the SWFAddress SEO rewriting.
- Including SWFAddress before the TITLE tag
- SWFAddress contains a fix for Internet Explorer and URLs which contain anchors. In order to benefit from it the title tag should be printed before the swfaddress.js include.
- Duplication of navigation logic
Integration of SWFAddress into a legacy code may require the following implementation:
For brand new projects, the best way to organize your code looks like this:
Update: The post has been updated for SWFAddress 2.0.