?
Solved

'target' tag is not being honored with Firefox-3.0 when we try to dynamically load a page

Posted on 2008-11-13
14
Medium Priority
?
267 Views
Last Modified: 2012-08-13
I have 3 frames say SeacrhInput, SearchResult and ContentFrame in my webpage.
In SearchInput frame, when we enter the search word followed by clicking a search button, a request would be sent to a python server which shows a set of links in the SearchResult frame (just below the search input frame) with the 'target' as ContentFrame as shown below:

<a href="search_result1.html" target="ContentFrame" >Result1 </a>

When I click on the above link, a request is sent to the server and the server shows the page in a new tab as opposed to the existing
ContentFrame in the same page. This was being honored with Firefox-2.x but not with Firefox-3. However it's worth noticing that all
the search result links are getting opened in the same tab but not that we see per tab per page/link.

PS: In my case, Firefox-3.0 config option 'security.fileuri.strict_origin_policy' is set to false.
I changed the config with

pref("security.fileuri.strict_origin_policy", false);

Any insights would highly be appreciated.
0
Comment
Question by:deltheta
  • 6
  • 6
12 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 22966099
Do you send any headers from the server, like
header("location:...; window-target:something");

?
0
 

Author Comment

by:deltheta
ID: 22973684

> Do you send any headers from the server, like
> header("location:...; window-target:something");
>?
The only information I send is the location for the pages/links, where would those be picked up from. I provide the base and meta tags for headers. The first few lines of help_search_results.html (this is the page which is being shown in the SearchResult frame) looks like as below:
 
 
<html>
<head>
<base href="http://localhost:9009//<absolute path of the base folder for all the pages>" \>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" href="support/help.css" charset="ISO-8859-1" type="text/css">
</head>
etc.
.
.
.
Let me know If I need to provide anything else.
 
0
 

Author Comment

by:deltheta
ID: 22973708
And also I set the 'target' tag for the individual search results in the body of the 'help_search_results.html'  (this is the page which is being shown in the SearchResult frame) as below:
<a href="search_result1.html" target="ContentFrame" >Result1 </a>
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 22973823
I have tested the following in my 3.0.3 - it works.
Can you try on yours?

<frameset rows="*,600,*">
<frame src="javascript:'<a href=http://www.google.com/search?q=frames target=contentFrame>Search</a>'">
<frame name="contentFrame" src="about:blank">
<frame src="javascript:'footer'>
</frameset> 

Open in new window

0
 

Author Comment

by:deltheta
ID: 22984530

Thanks for putting your effort into this but am scared is this is what I was intended for. I actually was not clear  in my initial post.

In your code snippet, the two frames belongs to the same frameset while my requirement is that search result page and individual search links are in two frames; not belonging to the same frameset. I can achieve the intended via static pages but when I query the same from python server, it's not coming as expected and getting opened in a new tab as opposed to the frame targeted.  Please have a look at the attachement for the same.

In the snapshot attached:

I have the main page consisting of two frames : LeftFrame & ContentFrame
This LeftFrame contains two subframes as SeacrhInput, SearchResult.
My requirement is that when we give some search word in the SearchInput frame and click on search button, a request would be sent to the python server and as a response, the python server shows the response page in SearchResult frame. Please note that the results can have more than one links.  The servers serves the links in the SearchResult
frame as below:

<a href="search_result1.html" target="ContentFrame" >Result1 </a>

When we click on any link in the SearchResult frame, the link should get opened in the ContentFrame. I was attaining the same with FireFox-2.x but with FireFox-3.0, it's getting shown in a new tab.

PS: Please note that I can achieve this with static pages but not with a server. And also the two frames in question (SearchResult and ContentFrame) don't belong to the same frameset, those are at different levels. ContentFrame is actually a frame belonging to the parent frameset of SearchResult.

Let me know if I need to do any additional thing to serve my purpose.
 

2.jpg
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 22985599
Normally I would expect that if a frame is named, it can be targetted.
So my initial reaction is that there is an issue with the names.

I would need to access the actual server with firefox and its console.

Michel
0
 

Author Comment

by:deltheta
ID: 22991708
Hi Michel,
> Normally I would expect that if a frame is named, it can be targetted.
> So my initial reaction is that there is an issue with the names.
I believe this is not a problem with the names for frames as it was working fine with FireFox-2.x but not with FireFox-3.0.  I am just wondering is this could be remotely related to config options available with FireFox-3.0, i.e. changing some config settings would be of any help.


> I would need to access the actual server with firefox and its console.
Am scared I could be of any help here because this python server can not be accessed from  the outside other than local host.  Let me know if you need some more details.
 
 
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 22992148
Can you use IFrames instead?
0
 

Author Comment

by:deltheta
ID: 23002564


Hi,
Yesterday I eventually happened to refresh/reload the main page (comprised of LeftFrame and ContentFrame as attached in one of my old posts) and realised that everything works fine henceforth; i.e. when I enter any search word and hit the search button, once help_search_results.html gets loaded in the searchResult frame, I press F5 or reload the page and then click on any of the search result pages from searchResult frame,  it gets opened in the ContentFrame as expected. You may have to refer to the earlier snapshot for the names of frames etc.

However when I tried to reload the page programatically, I could not achieve the same. I tried the below options:
1) In the help_search_results.html, I have something like this:
<body onload="top.parent.frames["ContentFrame"].reload(true); return false">

or

<body onload="top.parent.frames["ContentFrame"].reload(); return false">

2) I use onClick to explicitely reload the page while I set the 'target' tag for the individual search results in the body of the 'help_search_results.html'(this is the page which is being shown in the SearchResult frame) as below:

<a href="search_result1.html" target="ContentFrame" onclick="window.location.reload(); return false;">Result1 </a>

Am just wondering if is there any option using which I can programatically generate F5 or reload the page.  
 
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 23002909
Perhaps it is because it is

<body onload="top.parent.frames["ContentFrame"].location.reload(true);">

0
 

Author Comment

by:deltheta
ID: 23003221
> <body onload="top.parent.frames["ContentFrame"].location.reload(true);">
Ohh, actually that was a typo from my side; anyways thanks for pointing this out. I later ensured that am doing the right thing and then compared the error console with both FireFox-2.x and FireFox-3.0.  Am now using
<body onload="top.parent.frames['ContentFrame'].location.reload(true);">  
with Firefox-2.x it does not show any error while when I test the same with FireFox-3.0, I got the below-mentioned error on error console:
<Error>
Error: Permission denied to get property Location.reload

</Error>
It seems, from resultFrame I can't acess a property of a frame belonging to its grand-parent. If you recall,  I have a mainpage with two frames as LeftFrame and ContentFrame and LeftFrame inturn has two subframes as searchInput and searchResult and am trying to refresh the contentFrame from searchResult frame.  
PS: In my case, Firefox-3.0 config option 'security.fileuri.strict_origin_policy' is set to false. I changed the config with

pref("security.fileuri.strict_origin_policy", false);
I thought this would enable me to see the result links in the frame as specified in the target tag.
Am just wondering if modifying any other config option would come to my rescue? If you are aware of any such option; please let me know the same. Otherwise I believe we'd have to ask user to press F5 manually.
 
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 500 total points
ID: 23003702
If you still know the url, try

top.parent.frames['ContentFrame'].location=url
or

window.open(url,'ContentFrame')

since that is less of a security issue
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question