Source code for /src/view_src.htm.txt

//======================================================================//
// Author: Mark Qian <markqian@hotmail.com>                             //
// WWW: http://www.coolshare.com                                        //
// Copyright (c) 2006, Mark Qian                                        //
//                                                                      //
// You must contact Mark Qian to get a permission of use                //
// in case you want to make any use of the codes except viewing it     //
// on Mark's site.                                                      //
//======================================================================//


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>Remote View Source Dialog</title>
</head>
<script src="/html/js/expand.js"></script>
<script src="/html/js/remote_view.js"></script>
<body background="/html/images/rulebk.jpg">
 <table><tr><td><table width=100><tr><td></td></tr></table></td><td><table><tr><td>

<center> <h2>Remote View Source Dialog</h2>

<br>
<br>

<br>
</center>
 <br>
<pre>
<h3>Preface</h3>

It may seem that viewing source is as simple as a right mouse click and select "View Source".
But in many cases, you do want to pop a browser window with source when users click at a link:
  <li>You disable the right mouse click to prevent "ordinary" users to view source in subframes</li>
      but provide links for them to view the source you like to show
  <li> ...</li>

<b>Remote View Source Dialog</b> (<b>RVSD</b>) provides a handy way to view source of those
files that may be rendered by your browsers. For example, how do you display 
the source of your html files? You can't just make a link to it like following

     <a href="http://www.coolshare.com/html/common/contact.htm" target=_blank>http://www.coolshare.com/html/common/contact.htm</a>

since it is sent back with mine type "text/html" and browsers will try to render it
as a HTML file instead of displaying it as text, as you expect. Without server-
side effect, you can't change the mine type received. <b>RVSD</b>, using AJAX, allows you
to display files (from the same domain) in a textarea as following

    <a href="javascript:void(0)" onclick="remoteView('http://www.coolshare.com/html/common/contact.htm');return false">http://www.coolshare.com/html/common/contact.htm</a>



 </pre>
<script language="javascript" src="/html/js/cross_browser.js"></script>
<script language="javascript" src="/html/js/include_ajax.js"></script>
<script id="__include__">
  include.load("http://www.coolshare.com/html/common/contact.htm");
</script>

</body>
</html>