473,378 Members | 1,434 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

HTML page loads external frame

I have a main page that includes one menu and one iFrame.
Depending on the selections made on a menu, a different html page is
loaded inside the iFrame. The menu is just a list of <a href=...>

i.e. The user presses the "first" key on the menu, then the first page
is loaded inside the frame.

Find here a sample for the pages I use.

index.html
==========================================
<html>
<body>
<!-- menu here -->
<iframe src="first.htm"></iframe>
</body>
</html>
==========================================

first.html
==========================================
<p>
Hello world
</p>
==========================================

Here is my question. I want that when someone types in the browser
addressbar the address www.mysite.com/first.html, then instead of
loading just the "first.htm" l file, I want to see the entire
"index.html" page and the "first.html" file loaded inside the iFrame.
Is it possible? How can I do in order to do it?
Thank you much in advance.

Mario Jannelli
www.silverino.com

Jun 20 '06 #1
14 2082
Silver wrote:
Here is my question. I want that when someone types in the browser
addressbar the address www.mysite.com/first.html, then instead of
loading just the "first.htm" l file, I want to see the entire
"index.html" page and the "first.html" file loaded inside the iFrame.
Is it possible?


No

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jun 20 '06 #2
David Dorward wrote on 20 jun 2006 in comp.lang.javascript:
Silver wrote:
Here is my question. I want that when someone types in the browser
addressbar the address www.mysite.com/first.html, then instead of
loading just the "first.htm" l file, I want to see the entire
"index.html" page and the "first.html" file loaded inside the iFrame.
Is it possible?


No


Yes [if the diference between .htm and .html is a typo]
============= in first.html =============

<script type='text/javascript'>
if (self == top) location.href='index.html?f=first.html'
</script>

============= in index.html =============

select the f=filename by location.hash and load the iframe.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jun 20 '06 #3
Evertjan. wrote:
David Dorward wrote on 20 jun 2006 in comp.lang.javascript:
Silver wrote:
Here is my question. I want that when someone types in the browser
addressbar the address www.mysite.com/first.html, then instead of
loading just the "first.htm" l file, I want to see the entire
"index.html" page and the "first.html" file loaded inside the iFrame.
Is it possible?

No


Yes [if the diference between .htm and .html is a typo]
============= in first.html =============

<script type='text/javascript'>
if (self == top) location.href='index.html?f=first.html'
</script>

============= in index.html =============

select the f=filename by location.hash and load the iframe.


Better to do it with server-side and not depend on JavaScript

index.php?f=first.html

It is one of the nasty bit with frames, (iframes included) and I guess
to prevent breaking out of frames a non-javascript solution would be a
rewrite in the .htacess file.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Jun 20 '06 #4
Jonathan N. Little wrote on 20 jun 2006 in comp.lang.javascript:
============= in first.html =============

<script type='text/javascript'>
if (self == top) location.href='index.html?f=first.html'
</script>

============= in index.html =============

select the f=filename by location.hash and load the iframe.

Better to do it with server-side and not depend on JavaScript


Sure, but it can be done clientside.

index.php?f=first.html

It is one of the nasty bit with frames,
There are no frames to break out if (self == top), not?
(iframes included) and I guess
to prevent breaking out of frames a non-javascript solution would be a
rewrite in the .htacess file.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jun 20 '06 #5
Evertjan. wrote:
No
Yes [if the diference between .htm and .html is a typo]


Oh, misunderstood the question. It isn't trying to capture *any* page the
user tries to visit in the frame.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jun 20 '06 #6
David Dorward wrote on 20 jun 2006 in comp.lang.javascript:
Evertjan. wrote:
No

Yes [if the diference between .htm and .html is a typo]


Oh, misunderstood the question. It isn't trying to capture *any* page the
user tries to visit in the frame.


No harm done, that what's a NG is all about.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jun 20 '06 #7
Silver wrote:

Here is my question. I want that when someone types in the browser
addressbar the address www.mysite.com/first.html, then instead of
loading just the "first.htm" l file, I want to see the entire
"index.html" page and the "first.html" file loaded inside the iFrame.
Is it possible?

Evertjan. wrote:
[Yes]
============= in first.html =============

<script type='text/javascript'>
if (self == top) location.href='index.html?f=first.html'
</script>

============= in index.html =============

select the f=filename by location.hash and load the iframe.


For what reason do you need the hash? Its also possible to use SSI (if
available on the Server) and write into "index.html"

<iframe href="<!--#echo var="http_referer"-->"></iframe> (Don't worry
about the tag-looking construction in another Tag, this is just a
SSI-command which is replaced from the server before any browser has to
validate it)
Jun 20 '06 #8
Evertjan. wrote:
Jonathan N. Little wrote on 20 jun 2006 in comp.lang.javascript:
Better to do it with server-side and not depend on JavaScript


Sure, but it can be done clientside.


I didn't say it couldn't, just that it is better done server-side.
index.php?f=first.html

It is one of the nasty bit with frames,


There are no frames to break out if (self == top), not?


Won't work if I have JavaScript disabled....

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Jun 20 '06 #9
Jonathan N. Little wrote on 20 jun 2006 in comp.lang.javascript:
Evertjan. wrote:
Jonathan N. Little wrote on 20 jun 2006 in comp.lang.javascript:

Better to do it with server-side and not depend on JavaScript


Sure, but it can be done clientside.


I didn't say it couldn't, just that it is better done server-side.


You are repeating yourself.
index.php?f=first.html

It is one of the nasty bit with frames,


There are no frames to break out if (self == top), not?


Won't work if I have JavaScript disabled....


That can be said for all clientside code on this NG
and has nothing to do with the surmized nastiness of frames above.

So what is your point?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jun 20 '06 #10
jojo wrote on 20 jun 2006 in comp.lang.javascript:
Silver wrote:

Here is my question. I want that when someone types in the browser
addressbar the address www.mysite.com/first.html, then instead of
loading just the "first.htm" l file, I want to see the entire
"index.html" page and the "first.html" file loaded inside the iFrame.
Is it possible?

Evertjan. wrote:
[Yes]
============= in first.html =============

<script type='text/javascript'>
if (self == top) location.href='index.html?f=first.html'
</script>

============= in index.html =============

select the f=filename by location.hash and load the iframe.


For what reason do you need the hash? Its also possible to use SSI (if
available on the Server) and write into "index.html"


Because this NG is about javascript, and perhaps especially clientsided.

It can also be done by serverside javascript.

<iframe href="<!--#echo var="http_referer"-->"></iframe> (Don't worry
about the tag-looking construction in another Tag, this is just a
SSI-command which is replaced from the server before any browser has to
validate it)


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jun 20 '06 #11
Evertjan. schrieb:
jojo wrote on 20 jun 2006 in comp.lang.javascript:
Silver wrote:
Here is my question. I want that when someone types in the browser
addressbar the address www.mysite.com/first.html, then instead of
loading just the "first.htm" l file, I want to see the entire
"index.html" page and the "first.html" file loaded inside the iFrame.
Is it possible? Evertjan. wrote:
[Yes]
============= in first.html =============

<script type='text/javascript'>
if (self == top) location.href='index.html?f=first.html'
</script>

============= in index.html =============

select the f=filename by location.hash and load the iframe.

For what reason do you need the hash? Its also possible to use SSI (if
available on the Server) and write into "index.html"


Because this NG is about javascript, and perhaps especially clientsided.


I'm sorry, I missed that this question is crossposted... I read it at
alt.html which does not only deal with JavaScript...

It can also be done by serverside javascript.

<iframe href="<!--#echo var="http_referer"-->"></iframe> (Don't worry
about the tag-looking construction in another Tag, this is just a
SSI-command which is replaced from the server before any browser has to
validate it)


Jun 20 '06 #12
jojo wrote on 20 jun 2006 in comp.lang.javascript:
Because this NG is about javascript, and perhaps especially clientsided.


I'm sorry, I missed that this question is crossposted... I read it at
alt.html which does not only deal with JavaScript...


Same here but inverted.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jun 20 '06 #13
Evertjan. wrote:
Jonathan N. Little wrote on 20 jun 2006 in comp.lang.javascript:
Evertjan. wrote:
Jonathan N. Little wrote on 20 jun 2006 in comp.lang.javascript:
Better to do it with server-side and not depend on JavaScript
Sure, but it can be done clientside. I didn't say it couldn't, just that it is better done server-side.


You are repeating yourself.


Yes I am, your remarks seemed to challenge my assertions that
client-side option is vulnerable to client browser settings where are
server-side is not. Or is your problem a perspective problem, not
realizing this is a cross-posted thread.
index.php?f=first.html

It is one of the nasty bit with frames,
There are no frames to break out if (self == top), not?

Won't work if I have JavaScript disabled....


That can be said for all clientside code on this NG
and has nothing to do with the surmized nastiness of frames above.

So what is your point?


If you look he has cross-posted to alt.html where I am posting from. The
scope is a little more generalized.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Jun 20 '06 #14
Jonathan N. Little wrote on 20 jun 2006 in comp.lang.javascript:
So what is your point?


If you look he has cross-posted to alt.html where I am posting from. The
scope is a little more generalized.


Roger, oversaw the short named NG.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jun 21 '06 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jan Plastenjak | last post by:
This question is about html. I have this: <frameset rows="90%,10%" frameborder="NO" border="0" framespacing="0" cols="1"> <frame name="topFrame" noresize src="c:\bpp.xml"> <frame name="bottom" ...
2
by: Jon Haakon | last post by:
Hi, I'm developing a websolution using ASP and DHTML technology that's running on a MS IIS webserver. My solution is frame based with a toolbar on top, a hidden frame for scripts in the...
1
by: CST | last post by:
Hi All, I have a "Digital Dashboard" that basically has 4 IFrame sections. The page flows in the following order: Messages, Stocks, Weather, User Links. Please note that this order needs to...
6
by: Jaco | last post by:
I am looking for some examples (html code ..) of web page with a video (as wmv file) playing in a frame (using some Windows Media Player plugin). I don't need a specific server because my web pages...
25
by: Steal | last post by:
Hi at all I try to validate this page using the link: http://validator.w3.org/ but it return that this is not a valid HTML 4.01 page please where is it error? Steil <!DOCTYPE HTML PUBLIC...
11
by: opt_inf_env | last post by:
Hello everybody, I have created a page consisting of two frames. The second frame is made to display "external" sites (i.e. written not by me, for example www.google.com). But I found that some...
0
by: thompson_38 | last post by:
What is the difference between calling a HTML page stored on the local machine (axWebBrowser.Navigate("home.htm" ref 0, ref 0, ref 0, ref 0)) and being able to access a frame, to creating a...
2
by: c.l.rogers | last post by:
I've been searching for few days trying to find an answer to my question... hopefully I ofund the right place to help me out! What I am trying to do is use javescript inside column of a <table>...
1
by: reemamg | last post by:
Have a piece of code which works in Firefox however doesnt work in IE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> <meta...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.