Solved

Link to open a new window from a framed page

Posted on 2006-11-29
20
203 Views
Last Modified: 2010-04-09
Here's the caviat:

1. The framed page is within a frame

<frameset rows="90,*,42" frameborder="no" border="0" framespacing="0">
  <frame src="/includes/inc_top.asp" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />
  <frame src="http://contentURL/" name="mainFrame" id="mainFrame" title="mainFrame" scrolling="auto" />
  <frame src="/includes/footer.asp" name="bottomFrame" scrolling="No" noresize="noresize" id="bottomFrame" title="bottomFrame" />
</frameset>

The middle framed page (http://contentURL/) also contain 2 frames.

2. Here's the link to open the new window:
<a href="gotothislocation" target="_top">

I can't change anything else other than the "gotothislocation".. so target="_top" within the href is uneditable.

I tried: javascript:void(0);open.window('gotothislocation')" ... that doesn't work.

Please help shed some light.
0
Comment
Question by:dellon
20 Comments
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 18040726
dellon,

It seems like contentURL represents a different domain.  Is that the case?  If so, javascript isn't allowed to change it.  It is part of the security browsers have and a limit of javascript.  I assume you can't change the content of the files at contentURL.  If you can then you can change the html code yourself.  If not, then there is no way to tell it what frame to open in.

Let me know if you have any questions or need more information.

b0lsc0tt
0
 

Author Comment

by:dellon
ID: 18041388
Sorry if I was unclear. This is intranet between 2 servers. Let's call it server1 and server2. I'll try to draw it:

page in server1 (main intranet)
|-----------------------|
|         topFrame      |
|-----------------------|
|      mainFrame      |
|-----------------------|
|      bottomFrame   |
|-----------------------|

mainFrame contains contentURL on server2 (microsoft reporting services page)
|-----------------------|
|       topFrame2      |
|-----------------------|
|     mainFrame2      |
|-----------------------|

links exist on mainFrame2, and I want to open a new window by itself not within the frames.
The only thing I can edit is the href="" ... nothing else. target="_top" have to stay in the <a>.
So <a href="iCanOnlyEditThis" target="_top">
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 18041521
Thanks for the clarification.  I was a little confused in my reply because I assumed you needed the script in the "framed" page (i.e. the main frame page).

This would be so easy if you could change target="_top" to target="_blank".  Javascript will be needed but can you change the href to #?  For example a tag like this ...

<a href="#" target="_top" onclick="window.open('goToThisPage.htm','window2'); return false;">

Let me know how this works, if you can't use it, or if you have a question.

bol
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 18044340
Hi dellon,

Try to make the link:

javascript:window.open('gotothislocation'); return false;

So you would get:

<a href="javascript:window.open('gotothislocation'); return false;" target="_top">

Hope that helps :)

Regards,
Max.
0
 

Author Comment

by:dellon
ID: 18045887
b0lsc0tt : I wish =) I can't add nor edit any of the <a> attribute, other than the href.

DreamMaster: tried window.open .. doesn't work.
0
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 250 total points
ID: 18046882
Can you modify other parts of the page (i.e. head section of the html, body tag, add script tags)?  Modifying the href won't work.  We may have another way to do it if you can modify other parts of the page.

By the way, you are really getting me curious about why you can't modify the anchor tag, except href.

bol
0
 

Author Comment

by:dellon
ID: 18047626
It's a Microsoft Reporting Services. It's all .net and compiled, and the links is part of a recordset.

using window.open will result in opening gotothislocation on the parent window and the address bar on the browser reads:
javascript:window.open('http://gotothislocation/','newwindow')

If I open contentURL by itself (not within the mainFrame) and click the link, it works just fine.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 18051112
You could try using the href below ...

<a href="javascript: var newwindow = window.open('http://gotothislocation/','newwindow'); if (window.focus) newwindow.focus();">

Let me know what happens, especially look for errors.  I don't know that this will work but it worth the try.

bol
0
 

Author Comment

by:dellon
ID: 18117280
No go on that too my friend.

It opens on the parent window and spits out the javascript on the address bar.
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 18128383
I'm out of ideas then, at least right now. :)

I would suggest that you open a pointer in the Javascript topic area.  There is a tool at www.ee-stuff.com that members can use to make pointers.  Let me know if you have questions about making a pointer.  There are some experts there that may have a solution or some things to try.

bol
0
 

Author Comment

by:dellon
ID: 18134238
Thanks for trying. I'll look into pointer.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 18359964
Last suggestion:

javascript:void(window.open('http://gotothislocation/','newwindow'))
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 19219031
Mplungjan,

I suggest you could close this by either accepting my comment { http:Q_22076914.html#a18046882 } or by deleting/refunding.  The reason I suggest closing by accepting that comment is I don't think there is any way to do what Dellon wants given the conditions.  Since I can't be sure of that I will not object to delete/refund if Dellon wishes and/or you think it is best.  I hope this suggestion helps and thanks for all of your time cleaning, etc.

bol
0
 

Author Comment

by:dellon
ID: 19366805
Sorry none of these works for my issue.. but b0lsc0tt had been great and I don't mind giving him the points. Whichever you decide is fine with me.
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 19367936
Thanks for the comment Dellon.  I'm glad I could help and it was appreciated.  I just wish we could've had an option that worked but we were too limited.  If you can ever change the compiled part then my information will help you do what you wanted.  I like Mplungjan's recommendation but am OK if he decides to change it.

bol
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

758 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now