Skyzyx
04-15-2003, 10:48 AM
I didn't know about this until a few hours ago. I thought it was cool, so I thought I'd share it.
I got the code from brothercake, although I did add a few tweaks to it.
Just save this as a bookmark, and you can view the source of any site with just a click (even "protected" sites :rolleyes: )
javascript:var newWin=window.open(); newWin.document.body.innerHTML=('<b style="font-family:Verdana; font-size:9pt;">Source of '+location.href+'</b><br><br><br><xmp style="font-family:Verdana; font-size:8pt; color:#000080;"><html>'+document.getElementsByTagName('html')[0].innerHTML+'</html></xmp>'); newWin.select(); newWin.focus(); void(0);
Just remember to remove the space in "javascript:"
Roy Sinclair
04-15-2003, 03:02 PM
newWin.select() causes a javascript error.
Alex Vincent
04-16-2003, 02:45 AM
javascript:void(location.href="view-source:" + location.href)
Works in IE6 and Mozilla 1.4b nightly. :cool:
Quiet Storm
04-17-2003, 03:08 AM
Does not seem to work for me, just opens another window "about:blank"...
IE6/Win2k
allida77
04-17-2003, 04:35 AM
As promised it worked daily : Win2k ie6
and nightly : WinXP Pro ie6
for me
Skyzyx
04-17-2003, 06:49 AM
It works for me on Moz 1.4a and IE6 under Windows XP.
Internet Explorer's bookmarks suck though. You need to create a new bookmark as something else, then edit it with this information.
I've had no problems, and as I said, I didn't write it. I just slightly modified the code I got from someone else. I just thought this was useful.
Alex Vincent
04-18-2003, 02:57 AM
Um, which version are you guys testing and giving "Did it work" comments for?
allida77
04-18-2003, 07:36 AM
I tried yours because I am lazy and it was shorter. It is a very useful script.
Borgtex
04-18-2003, 09:49 PM
This one even allows you to edit the HTML of the page "on the fly":
javascript:a=window.open('','','width=500,height=500,resizable=yes');a.document.write('<TEXTAREA cols=70 name=Sor rows=20 style="WIDTH: 100%" wrap=off></TEXTAREA><INPUT value=Submit type=button onClick="top.window.opener.document.write(Sor.value);top.window.opener.document.close()">');a.Sor.value=document.getElementsByTagName('html')[0].innerHTML;void(0);
shlagish
05-15-2003, 01:56 AM
How can I make
java script:var newWin=window.open(); newWin.document.body.innerHTML=('<b style="font-family:Verdana; font-size:9pt;">Source of '+location.href+'</b><br><br><br><xmp style="font-family:Verdana; font-size:8pt; color:#000080;"><html>'+document.getElementsByTagName('html')[0].innerHTML+'</html></xmp>'); newWin.select(); newWin.focus(); void(0);
a bookmark?
Do I save this line in a notepad document and save THAT as a bookmark?
I don't understand.
cheesebagpipe
05-18-2003, 08:56 AM
Borgtex...
:thumbsup: :thumbsup:
Added 'wrap=virtual', then spent 40 minutes sprinkling the front page of the New York Times website with obscenities and absurdities. Great fun. Tomorrow: msdn.
cbp
scroots
05-18-2003, 09:58 AM
to make it into a bookmark, you get it all in one line then go Bookmarks > Add Bookmark (or Favourites> Add to favourites) then in the page address paste the line in that box.
scroots
shlagish
05-18-2003, 05:52 PM
ok thanks :)
edit:
hmm, I don't get it, when I press Add to favorites, it adds THIS page, if I put that line in the box it will only change the NAME of the favorite... I tried putting that line in the adress bar and pressing enter, that opened a new window with nothing in it, but it didn't change the page I'm in now (This page)
help?
/edit