There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: Source code as a target.


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
needafix's Avatar
Senior Member with 862 posts.
 
Join Date: Mar 2005
Experience: Advanced
20-Nov-2006, 03:12 AM #1
Solved: Source code as a target.
Is there a way to have a link in an html doc whose target is the source code of the same html doc or the source code of another html doc?

I can open the doc from a link but then I just have to open the source code.

If I could go directly to that source code it would save thousands of click in the long run.
MMJ's Avatar
MMJ MMJ is offline
Distinguished Member with 3,202 posts.
 
Join Date: Oct 2006
20-Nov-2006, 04:55 AM #2
Is this what you mean?

PHP Code:
<?php include('template/header.php'); ?>
example of it in use: http://xenweb.net/forums/showthread....vity-7143.html
needafix's Avatar
Senior Member with 862 posts.
 
Join Date: Mar 2005
Experience: Advanced
21-Nov-2006, 03:00 AM #3
No.
brendandonhu's Avatar
Distinguished Member with 15,988 posts.
 
Join Date: Jul 2002
Location: Ann Arbor, MI
Experience: Advanced
21-Nov-2006, 04:48 PM #4
Is this what you're looking for?
<a href="view-source:http://www.google.com/">View Source</a>
It will link to the source of the HTML doc but it doesn't work in newer versions of IE.

Last edited by brendandonhu : 21-Nov-2006 04:53 PM.
namenotfound's Avatar
Computer Specs
Distinguished Member with 2,083 posts.
 
Join Date: Apr 2005
Location: New York
Experience: I know what I know, I am
21-Nov-2006, 05:08 PM #5
Quote:
Originally Posted by brendandonhu
Is this what you're looking for?
<a href="view-source:http://www.google.com/">View Source</a>
It will link to the source of the HTML doc but it doesn't work in newer versions of IE.
I forgot all about the pseudo-link "view-source"
Eriksrocks's Avatar
Computer Specs
Senior Member with 1,859 posts.
 
Join Date: Aug 2005
Location: Minnesota
Experience: Advanced
21-Nov-2006, 09:52 PM #6
Quote:
Originally Posted by brendandonhu
Is this what you're looking for?
<a href="view-source:http://www.google.com/">View Source</a>
It will link to the source of the HTML doc but it doesn't work in newer versions of IE.
That's pretty sweet.

I didn't even know that existed.
MMJ's Avatar
MMJ MMJ is offline
Distinguished Member with 3,202 posts.
 
Join Date: Oct 2006
22-Nov-2006, 05:44 AM #7
Nice! Is it valid strict?
Eriksrocks's Avatar
Computer Specs
Senior Member with 1,859 posts.
 
Join Date: Aug 2005
Location: Minnesota
Experience: Advanced
22-Nov-2006, 09:35 AM #8
I assume so.
namenotfound's Avatar
Computer Specs
Distinguished Member with 2,083 posts.
 
Join Date: Apr 2005
Location: New York
Experience: I know what I know, I am
22-Nov-2006, 09:54 AM #9
Quote:
Originally Posted by MMJ
Nice! Is it valid strict?
pseudo-links such as view-source: and javascript: in urls don't effect the w3c validation tool, so they are valid. Although not part of a "standard" hyperlink, they are valid.
needafix's Avatar
Senior Member with 862 posts.
 
Join Date: Mar 2005
Experience: Advanced
22-Nov-2006, 08:06 PM #10
Quote:
Originally Posted by brendandonhu
Is this what you're looking for?
<a href="view-source:http://www.google.com/">View Source</a>
It will link to the source of the HTML doc but it doesn't work in newer versions of IE.
Almost I guess.

This works for Google:

<a href="view-source:http://www.google.com/">View Source</a>

but this:

<a href="view-source:C:\My Documents\My Pictures\new.htm">NSC</a>

doesn't work for what I was talking about.

I use IE6 SP1. Is that why it works on the web but not on my hard drive?

I update this document often and need to go directly to the source code instead of opening the file then viewing the source then closing the document then saving the source code.
Eriksrocks's Avatar
Computer Specs
Senior Member with 1,859 posts.
 
Join Date: Aug 2005
Location: Minnesota
Experience: Advanced
22-Nov-2006, 08:27 PM #11
Do something like this:

<a href="view-source:file:///C:/My%20Documents/My%20Pictures/new.htm">NSC</a>
namenotfound's Avatar
Computer Specs
Distinguished Member with 2,083 posts.
 
Join Date: Apr 2005
Location: New York
Experience: I know what I know, I am
22-Nov-2006, 10:04 PM #12
Yes I just tested it out with an html file on my computer. What Eriksrocks said should work, it does for me

Edit: Well it worked on Firefox I just tried on IE7 and it doesn't work. However you have IE6 so it *might* work, give it a try
__________________
-----------------------------
| 404: Name Not Found |
-----------------------------
PLEASE NOTE: If I happen to help you in a post, or just simply reply to it, doesn't mean I want to be bombarded with PMs. I answer all questions in posts, not in PMs. Thank you, and have a good day.

<?php $h = 'Hello '; $w = 'World'; echo $h.$w; ?>

My Favorite Editors:
Windows: Crimson Editor
Mac: Taco HTML Edit
Linux: gPHPEdit
Eriksrocks's Avatar
Computer Specs
Senior Member with 1,859 posts.
 
Join Date: Aug 2005
Location: Minnesota
Experience: Advanced
22-Nov-2006, 10:52 PM #13
Yeah, I was wondering if it would work in IE. Actually now that I try it in IE7, even this doesn't work:
view-source:http://www.google.com/

Oh, IE.... *sigh*
brendandonhu's Avatar
Distinguished Member with 15,988 posts.
 
Join Date: Jul 2002
Location: Ann Arbor, MI
Experience: Advanced
22-Nov-2006, 10:55 PM #14
They dropped this in IE6 after SP1 for security reasons.
needafix's Avatar
Senior Member with 862 posts.
 
Join Date: Mar 2005
Experience: Advanced
22-Nov-2006, 10:56 PM #15
Quote:
Originally Posted by Eriksrocks
Do something like this:

<a href="view-source:file:///C:/My%20Documents/My%20Pictures/new.htm">NSC</a>
Cool. That did the trick. Minus the %20. Don't need that.

Now editing that is three clicks: Click link to open, click X to close, click "save."

The "click factor" is very important to me, the less clicks, the more efficient.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 09:28 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.