- Impact
- 6
This code allows your visitors to type any url in a text box and will attempt to retrieve the source code. View example: http://www.webdesigntalk.net/tools/viewsource.html
Add this to the head section of your page:
Add this to the body section of your page:
Add this to the head section of your page:
Code:
<script language="JavaScript" type="text/javascript">
<!-- Code by deadserious - http://www.webdesigntalk.net -->
function http(){
if (document.getsource.view.defaultvalue != document.getsource.view.value)
{document.getsource.view.value = "View Source"}
if (document.getsource.url.defaultvalue != document.getsource.url.value)
{document.getsource.url.value = "http://"}
}
function viewSource(){
document.getsource.view.value="One Moment Please";
var geturl = document.getsource.url.value; {
var SourceUrl = "view-source:" + geturl ; location.href = SourceUrl;
}
}
</script>
Code:
<form name="getsource" action="">
<b>URL:</b> <input type="text" name="url" onfocus="http()"
value="http://" /> <input type="button" name="view"
value="View Source" onclick="viewSource()" />
</form>