Link to open a new window from a framed page

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.
dellonAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
b0lsc0ttConnect With a Mentor IT ManagerCommented:
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
 
b0lsc0ttIT ManagerCommented:
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
 
dellonAuthor Commented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
b0lsc0ttIT ManagerCommented:
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
 
DreamMasterCommented:
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
 
dellonAuthor Commented:
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
 
dellonAuthor Commented:
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
 
b0lsc0ttIT ManagerCommented:
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
 
dellonAuthor Commented:
No go on that too my friend.

It opens on the parent window and spits out the javascript on the address bar.
0
 
b0lsc0ttIT ManagerCommented:
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
 
dellonAuthor Commented:
Thanks for trying. I'll look into pointer.
0
 
Michel PlungjanIT ExpertCommented:
Last suggestion:

javascript:void(window.open('http://gotothislocation/','newwindow'))
0
 
b0lsc0ttIT ManagerCommented:
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
 
dellonAuthor Commented:
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
 
b0lsc0ttIT ManagerCommented:
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
All Courses

From novice to tech pro — start learning today.