Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

View Source Link - How? 11

Status
Not open for further replies.

JennyW

Technical User
Mar 1, 2001
323
CA
Hiee, long time no writey.

I wanted to create a link that “Views the source code”.
Does anyone know how to make a link do this?

Here’s my attempt at it…

<a href=&quot;view-source: isn’t a real page.com</a>

Thanks people,
Jenny
 
Hi everyone,

I can’t get my “view source” html code (above) to work.
Where did I go wrong?

Thanks,
Jenny
 
I think you need to have a file name in the link, not just the site name. Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Hi,
I looked at your code and I saw where I went wrong PepperPepsi.

Here's the code...
<a href=&quot;view-source: isn’t a real page.com</a>

I had a &quot; colon - : &quot; after &quot; &quot;
instead of a semi colon - ;

I have to pay attention to details a little more. Oh dear.

tsdragon,
I've been doing what you wrote in other tests. Anyway, you read the above, and that's a wrap!

Thanks guys,
Jenny
 
Hiee,
Ok, I’ve been having trouble.

It seems I CAN view the source when I link it to an http:// address, like this…

<a href=&quot;view-source: Source</a>

But I CAN’T view the source when I link it to my own internal file, like this…

<a href=&quot;view-source:0008_jenny.html&quot;;>View Source</a>

Is this how the code is suppose to act?

Thanks again,
Jenny
 
Hi Jenny, you can try these,

<script>
function viewThis(url) {
window.location.href=&quot;view-source:&quot;+url
}
</script>

<a href=&quot;javascript:viewThis('file:///C|/someDIR/DIRsub/filename.html')&quot;;>Internal Page's source code</a>

<a href=&quot;javascript:viewThis(window.location)&quot;;>This Page's source code</a>

hope this helps,
Chiu Chan
cchan@emagine-solutions.com
 
Hi Peppy!

Ok, I tried both of your suggestions, but I'm still unable to view an internal files source.

Here's my page, maybe if you get some time you can take a look? Whatever works for you, I know it's the weekend and everyone's busy and relaxing!

Here's my page...


Thanks,
Jenny
 
Hi Peppy,
The second link still doesn't work (the internal file).
I pretty darn sure that it's the right path.

Ok, when I have spaces in a folder's name, for example...

Root Folder

...do I need to replace the space in between &quot;Root&quot; and &quot;Folder&quot; with some sort of character?


I've been writing &quot;Root Folder&quot; in my code. I'm not inserting anything in the space.

Thanks so much!
Jenny

 
Try using %20 or + instead of the space. Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Hey tsdragon,
I tried the % character, but I'll give the + a try and let you know.

Thanks,
Jenny
 
Jenny, i don't know if you have your answer or not, but this is a little ditty i created that lets me pinch coding, it might do the trick for you.

either copy it straight into the URL as
javascript:document.write('<plaintext>' + document.documentElement.outerHTML + '</plaintext>')
or add it to a HTML document as
<a href=javascript:document.write('<plaintext>' + document.documentElement.outerHTML + '</plaintext>')>Show Source Code</a>

This will only view the source of the current page, i don't know if that is what you are looking for.

Let me know anyways,
DeltaFlyer ;-)

DeltaFlyer - The Only Programmer To Crash With Style.
 
Hiee Deltaflyer,

Actually, I’m able to view the source of the page that I’m currently on.

I just can’t figure out how to view the source of another one of my internal pages (one of the pages I’m not currently on, but is part of my website).

I know I could view the code of any page after I upload my site (use but there should be a way to view a page’s source by using the file name.

Here’s my url…

I’m gonna try tsdragon’s “+” idea a shot.

--------
Another question for anyone out there...

How do you guys and gals get your posted text (on this website) to show up in italics, bold, color etc.?

Thanks,
Jenny
 
We use TGML (Tecumsah Group Markup Language), similar to HTML. To see what you can do click on the words &quot;Process TGML&quot; next to the checkbox at the bottom of the reply form.
Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Thanks tsdragon
for the TGML info.

I also tried inserting the &quot;+&quot; character in between the spaces of my files folders (file names), but it still didn't work. I'm still unable to view an internal files source code.

Thanks again!
Jenny
 
Hi,
I also tried &quot;%20&quot;, but that didn't work either.

Jenny
 
Jenny,

i've been to lazy to read all the posts extensively, but the idea of the &quot;%20&quot; or &quot;+&quot; is to replace the spaces with. I know for sure NN hates spaces in adresses.

My apologies if i kick in an open door,
Ronald.
 
when I tried to look at the page I got this error.

can not open the c:\my documents ........

Check to see how the links/pages are saved.

Manic -----------------------------
I've broken it again !!
-----------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top