Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Sunday, January 25, 2009

Bookmarklet - View Rendered HTML Source Code

Developing DHTML applications can be challenging, often the rendered HTML source code is dynamically assembled via JavaScript or AJAX and is dramatically different than the original source code of the Web page.

To view the raw rendered source code of an HTML page, save the following link as a bookmark, then navigate to the HTML page and click the bookmark.

javascript:document.write('<pre>' + document.body.innerHTML.replace(/</g,'&lt;').replace(/>/g,'&gt;') + '</pre>');

Monday, March 31, 2008

Unobtrusive JavaScript

I recently read several articles about the merits of Unobtrusive JavaScript, a programming paradigm that encourages the separation of functionality from structure, content, and presentation. Some key benefits of Unobtrusive JavaScript include:

  • Better accessibility
  • Improved portability
  • Faster development
  • Simpler code maintenance
  • Graceful degradation of functionality

Some scripting event types that developers commonly commingle with document content and structure include:

  • onclick()
  • onfocus()
  • onblur()
  • onmouseover()
  • onmouseout()
  • onload()
  • onchange()
  • onsubmit()

Inline JavaScript functions can be difficult to maintain, especially if there are numerous occurrences of the inline code sprinkled throughout the website or if multiple people work on the same website. This is especially true when Web developers working with WYSIWYG editors make changes to the site, since the WYSIWYG editors have a tendency to mangle code.

Sunday, March 23, 2008

Windows Live Messenger SDK

Microsoft has announced a software development kit (SDK) for Windows Live Messenger:

Let web site visitors interact with Windows Live Messenger users using the Windows Live Messenger Library, Windows Live Messenger IM Control, and the Windows Live Presence API.  You can also use the Windows Live Messenger client, version 7.0 and later, to develop a single-user or multi-user application through the Windows Live Messenger Activity API.

According to Microsoft the software development kit provides:

  1. IM Control - The IM Control enables web sites to show the presence of Windows Live Messenger users and let site visitors engage in IM conversations with site owners or representatives.
  2. Presence API - The Presence API is an HTTP-based API that returns a Windows Live Messenger user's presence.
  3. Messenger Library - The Windows Live Messenger Library is a client-side JavaScript library that enables third-party sites to seamlessly add instant messaging capabilities with Windows Live Messenger.