Solved

Link to open a new window from a framed page

Posted on 2006-11-29
20
211 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
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 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
 
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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

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.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

726 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