logo

Response

« Return to the main article

You are viewing this page out of context. To see it in the context it is intended please click here.

About This Page

Reply posted by John Z Marshall on Tue 15 May 2001 in response to Create your own items in IE's Context-Menu

Validate HTML page

Using the same principles detailed in the article I added a new usefull command
to the context menu called Validate HTML. Which calls the WC3 HTML Valdation
service.


Create a web page with the following code e.g. call validate.htm


<HTML>


<input type="edit" name="location" value="">


<SCRIPT LANGUAGE="JavaScript" defer>


var win = external.menuArguments;
document.all.location.value = win.document.location.href;


window.location = "http://validator.w3.org/check/referer?uri=" +
encodeURI(document.all.location.value) + "&doctype=Inline&ss=&outline=&sp=";


</SCRIPT>
</HTML>



Then add the appropriate registry entry with an name of e.g. Validate HTML.


When IE is restarted the Validate HTML option will appear in the context-menu.


Notes: You must have a live Internet connection for this to work.
The Opera browser has this feature built in.
The Javascript code above may not be best way to do it as I am not a Javascript
guru but it seems to work.