Is there any way by which I can display the source of a html page
using the 'view:source' command, in an iframe??
I tried using this
viewer.location = "view-source:" + viewer.location .href;
where viewer is an iframe.
but it opens the source in a notepad.
Instead of the source getting displayed in the notepad, I would like
the iframe to display the source.
Thanks in advance 6 1942
shr wrote: Is there any way by which I can display the source of a html page using the 'view:source' command, in an iframe?? I tried using this viewer.location = "view-source:" + viewer.location .href; where viewer is an iframe. but it opens the source in a notepad.
Instead of the source getting displayed in the notepad, I would like the iframe to display the source.
You could use server-side scripting to serve the page with the HTTP header
Content-Type: text/plain
instead of the associatd text/html but IE is known to try to sniff the
content and ignore that. Client-side script is not going to help, at
least not across browsers.
--
Martin Honnen http://JavaScript.FAQTs.com/
shr wrote on 29 sep 2004 in comp.lang.javas cript: Is there any way by which I can display the source of a html page using the 'view:source' command, in an iframe?? I tried using this viewer.location = "view-source:" + viewer.location .href; where viewer is an iframe. but it opens the source in a notepad.
Instead of the source getting displayed in the notepad, I would like the iframe to display the source.
<http://groups.google.c om/groups?th=693cf 051b8e70a91>
for IE, because that was on a jscript group.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)
"Martin Honnen" wrote shr wrote: Instead of the source getting displayed in the notepad, I would like the iframe to display the source.
You could use server-side scripting to serve the page with the HTTP header Content-Type: text/plain instead of the associatd text/html but IE is known to try to sniff the content and ignore that. Client-side script is not going to help, at least not across browsers.
This bookmarklet writes the generated source in the page, you could turn it
into a regular function:
javascript :'<co de><ol><li>'+(d ocument.documen tElement||docum ent.body).outer H
TML.replace(/&/g,"&").repl ace(/</g,"<").repla ce(/ /g,"
").replace(/\n/g,"<li>")+'<\/ol><\/code>';
The the downloaded source and the generated source may differ significantly.
You can get the first one in a variable with the XML HTTP Request object.
See
<URL: http://jibbering.com/2002/4/httprequest.html >
--
Ivo
Martin Honnen wrote: shr wrote: Is there any way by which I can display the source of a html page using the 'view:source' command, in an iframe?? [...] Instead of the source getting displayed in the notepad, I would like the iframe to display the source.
You could use server-side scripting to serve the page with the HTTP header Content-Type: text/plain instead of the associatd text/html but IE is known to try to sniff the content and ignore that. Client-side script is not going to help, at least not across browsers.
However, if server-side scripting is available, ways are available
to convert "<" to "<" and ">" to ">". Not even IE will try
to parse the content then. The document must be served as text/html
(or application/xhtml+xml) with a surrounding "body" element, though.
The "pre" element should come in handy then.
PointedEars
--
If there were no BUGs........... .we wouldn't have our jobs!
Thomas 'PointedEars' Lahn wrote: However, if server-side scripting is available, ways are available to convert "<" to "<" and ">" to ">". Not even IE will try to parse the content then. The document must be served as text/html (or application/xhtml+xml) with a surrounding "body" element, though. The "pre" element should come in handy then.
Or, much more simple, if server-side PHP is available and the file is
on an ext2 compatible filesystem, one could place a symlink with the
suffix .phps to point to the .html file (if the filesystem is not
ext2 compatible, a renamed copy of the .html file is required). PHP
will then output the color-coded source code if used as an Apache
module, the Apache configuration contains
AddType application/x-httpd-php-source .phps
and the .phps file is accessed as HTTP resource. Example:
<http://www.pointedears .de/scripts/test/dom.xhtml.phps>
PointedEars
--
"I have the heart of a small boy -- and I keep it in a jar on my desk."
Thomas 'PointedEars' Lahn wrote: Thomas 'PointedEars' Lahn wrote:
However, if server-side scripting is available, ways are available to convert "<" to "<" and ">" to ">". Not even IE will try to parse the content then. The document must be served as text/html (or application/xhtml+xml) with a surrounding "body" element, though. The "pre" element should come in handy then.
Or, much more simple, if server-side PHP is available and the file is on an ext2 compatible filesystem, one could place a symlink with the suffix .phps to point to the .html file (if the filesystem is not ext2 compatible, a renamed copy of the .html file is required). PHP will then output the color-coded source code if used as an Apache module, the Apache configuration contains
AddType application/x-httpd-php-source .phps
Since you bring it up, that extension can be just about anything you
want it to be, including - but not limited to - phps. Personally, I use
the extension .source instead of phps which can be misleading.
--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Gary DeRousse |
last post by:
Hello,
Using SQL Server 2000, I'm trying to put together a query that will
tell me the following information about a view:
The View Name
The names of the View's columns
The names of the source tables used in the view
The names of the columns that are used from the source tables
Borrowing code from the VIEW_COLUMN_USAGE view, I've got the code
|
by: Pete Wason |
last post by:
Hiall!
I have a demo viewer page for javascript stuff that has three buttons "DEMO"
"HTML" and "JSCR", and an IFRAME called 'viewer'.
Initially, the IFRAME gets loaded with the actual demo page, ie.,
viewer.location = dName + '.html';
where dName is the filename of the demo without extension.
|
by: Nancy |
last post by:
Hi, Guys,
I don't know why I can't view some webpages source code by click
"View->Source" menu of Browser. These webpage source code can be
viewed in same way by using other computers. My OS is Win Xp and
Browser is IE6.0. I don't use any fire wall.
Appreciate any hint.
Nancy
|
by: Michael Hill |
last post by:
I saw a site that looked pretty good, but I could view the source.
2 questions:
1) how can I do the same for my site
2) any way to get around this?
Mike
|
by: Lorem Ipsum |
last post by:
interesting! I just found a page in which Explorer's View Source does
nothing! How did they do that?
| |
by: Alvo von Cossel I |
last post by:
hey everybody,
I have written a great browser but it is missing a feature (quite a lot
actually, but forget about them for now). that feature just so happens to be
the View > Source function. for those of you who don't what i mean, it is
when you click a button in the view menu that says Page source (in Netscape)
and source (in Internet Explorer). if you click it, notepad opens. in that
window is the html for the page.
anyway, does...
|
by: dwok |
last post by:
Does anyone know of a good article that discusses creating a "Tree
View" control in ASP.NET? Or perhaps a Tree View Control that comes
with source code? I have come across a lot of tree controls for ASP.NET
however most of them are already compiled and don't come with source
code. I am really just looking for an example on how to create my own
Tree Control. Thanks a bunch.
|
by: steph |
last post by:
Hi,
A question regarding Access 2002:
I've got a form which should be displayed in Form View and in Datasheet
View. But I want to use a different record source for each view. That
means, when the view is switched I want to switch the record source
also.
I tried to put this functionality on the "On View Change" event, but
|
by: Don |
last post by:
I have a page that has several controls on it and the controls are
shown or hidden during postback. I show and hide them using the
visible property. When I use 'view source' in Internet Explorer I
always see the source of the first version of the page, with the
controls rendered that where rendered on the first visit. The changes
that occur during postback are not reflected in 'view source'.
Example Detail:
My page has 6 controls and...
|
by: Jacob Donajkowski |
last post by:
Once the user logs in I want to have the users switch from the Roster
View to the Profile View and enter their profile infomation and save
it. Then the next time they login and go to the Profile View I want
the form populated from there profile on the sql server. The code to
save the profile works fine. But when the user logs back in they data
doesn't load back to the form. The multiview is located inside the
LoginView's Logged-In View ....
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |