felgall
01-08-2006, 09:32 PM
Why not just insatall a view-source bookmarklet in your browser. Then you can select that from the favorites/bookmarks menu to view the source of any page. http://javascript.about.com/library/blsource.htm
Alternatively the following user script installed into Internet Explorer (with Turnabout plugin), Firefox (with Greasemonkey extension), or Opera will add a "Source" link to the bottom of all web pages on the web to allow you to click and view the source of any web page easily.
// ==UserScript==
// @namespace http://javascript.about.com
// @author Stephen Chapman
// @name View Source Link
// @description Adds a View Source link to the bottom of all web pages
// @include *
// ==/UserScript==
// This script (tested in both Firefox/Greasemonkey and Opera) will add a
// View Source link to the bottom of ALL web pages in the included domains.
// This will aid you in your web page development as it shows the HTML the
// way that the browser currently sees it and so enables you to easily see
// the effects of running a Javascript to update the HTML.
var a = document.createElement("a");
a.style.color = "#cccccc";
a.style.backgroundColor = "#666666";
a.style.textDecoration = "none";
a.style.fontSize = "70%";
a.href = "javascript:c=unescape(document.documentElement.innerHTML);c=c.replace(/&/g,'&amp;');c=c.replace(/</g,'&lt;');c=c.replace(/>/g,'&gt;');document.write('<html><head><title>Source of Page</title></head><body><div align=\"center\"><a href=http://codingforums.com/archive/index.php/\"#\" onclick=\"history.back();return false;\">Back</a></div><pre>' + c + '</pre></body></html>');";
a.appendChild(document.createTextNode('Source'));
document.body.appendChild(a);
Alternatively the following user script installed into Internet Explorer (with Turnabout plugin), Firefox (with Greasemonkey extension), or Opera will add a "Source" link to the bottom of all web pages on the web to allow you to click and view the source of any web page easily.
// ==UserScript==
// @namespace http://javascript.about.com
// @author Stephen Chapman
// @name View Source Link
// @description Adds a View Source link to the bottom of all web pages
// @include *
// ==/UserScript==
// This script (tested in both Firefox/Greasemonkey and Opera) will add a
// View Source link to the bottom of ALL web pages in the included domains.
// This will aid you in your web page development as it shows the HTML the
// way that the browser currently sees it and so enables you to easily see
// the effects of running a Javascript to update the HTML.
var a = document.createElement("a");
a.style.color = "#cccccc";
a.style.backgroundColor = "#666666";
a.style.textDecoration = "none";
a.style.fontSize = "70%";
a.href = "javascript:c=unescape(document.documentElement.innerHTML);c=c.replace(/&/g,'&amp;');c=c.replace(/</g,'&lt;');c=c.replace(/>/g,'&gt;');document.write('<html><head><title>Source of Page</title></head><body><div align=\"center\"><a href=http://codingforums.com/archive/index.php/\"#\" onclick=\"history.back();return false;\">Back</a></div><pre>' + c + '</pre></body></html>');";
a.appendChild(document.createTextNode('Source'));
document.body.appendChild(a);
