?
Solved

open new browser window action

Posted on 2003-03-13
5
Medium Priority
?
281 Views
Last Modified: 2010-04-25
i used the "open new browser window" action for a link in a page (http://www.harveywang.com/now.html   - to be specific).  i wanted it to open a new window for an off-site link, but leave the original page where it was.  my intention was to let people explore other pertinent links, but be able to easily return to the original site by returning to the browser window underneath.  problem is, when you click the link, the new browser window opens with the new URL, but the the window underneath ALSO changes to the new linked URL, completely defeating my purpose.  am i using the wrong technique to achieve my goal, or am i missing something?

as of now, in the BEHAVIORS/ACTIONS palette i have the action as ON CLICK and OPEN NEW BROWSER WINDOW.  then i entered in the URL and checked the various options such as scroll bar, status bar, etc.  

i appreciate any insight anyone has!  

best, sabrina
0
Comment
Question by:sabrina718
[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
  • 3
  • 2
5 Comments
 

Expert Comment

by:WebDevAng
ID: 8131307
Sabrina,
Instead of
<a href="http://www.harveywang.com" target="_top"...

Change it to
<a href="http://www.harveywang.com" target="_new"...

You could also (and I prefer) add this as an onclick function of the <td> or image, then add the JavaScript function such as:

<td onclick="openNewPage('http://www.msn.com')">Click Here</td>


This should be inserted between the <head></head> tags:

<script language="JavaScript">
<!--

function openNewPage(thePage) {
nwin=window.open(thePage, "_new",config="scrollbars=yes,resizable=yes,toolbar=yes,location=yes,status=yes,menubar=yes,");
     nwin.focus();
}
//-->
</script>

0
 

Author Comment

by:sabrina718
ID: 8137009
re:
Change it to <a href="http://www.harveywang.com" target="_new"...

does that only work for a placed image?  i tried it on the rollovers and it works perfectly.  but how do i apply that for the html text links?

ie, on the same page, http://www.harveywang.com/now.html  in the first row of the table of current events, there is a text link for Full Frame's website in the last line.  this is where is applied the DW action beahvior of ON CLICK and OPEN NEW BROWSER WINDOW.  

i looked at the code for that and there is no TARGET tag.  

also, on the previous java scripting tip, re:

function openNewPage(thePage) {
nwin=window.open(thePage, "_new",config="scrollbars=yes,resizable=yes,toolbar=yes,location=yes,status=yes,menubar=yes,");
     nwin.focus();
}
//-->
</script>

do i put this just right underneath the script language indication in the head?

PS - i can't thank you enough for your insight!  i am a graphics person who has been trying to teach myself this web stuff with books for the last year +!  sometimes i need soemone to fill in the holes, so i am glad to have found this website!
0
 

Author Comment

by:sabrina718
ID: 8137279
re:
Change it to <a href="http://www.harveywang.com" target="_new"...

does that only work for a placed image?  i tried it on the rollovers and it works perfectly.  but how do i apply that for the html text links?

ie, on the same page, http://www.harveywang.com/now.html  in the first row of the table of current events, there is a text link for Full Frame's website in the last line.  this is where is applied the DW action beahvior of ON CLICK and OPEN NEW BROWSER WINDOW.  

i looked at the code for that and there is no TARGET tag.  

also, on the previous java scripting tip, re:

function openNewPage(thePage) {
nwin=window.open(thePage, "_new",config="scrollbars=yes,resizable=yes,toolbar=yes,location=yes,status=yes,menubar=yes,");
     nwin.focus();
}
//-->
</script>

do i put this just right underneath the script language indication in the head?

PS - i can't thank you enough for your insight!  i am a graphics person who has been trying to teach myself this web stuff with books for the last year +!  sometimes i need soemone to fill in the holes, so i am glad to have found this website!
0
 

Accepted Solution

by:
WebDevAng earned 300 total points
ID: 8137537
Okay,
First thing you need to do:

Put all your Javascript functions between 1 set of <script> tags.

Something like this:

<head>
<title>Harvey Wang - Now</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" src="Images/mm_menu.js"></script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

(so on and so on.  I won't add them all here because it garbles up this page)

//-->
</script>

Remove all the extra //--> and <script> tags that aren't being used.

Second,
Change:

<a href="http://www.fullframefest.org/" onClick="MM_openBrWindow('http://www.fullframefest.org/','','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes')">web site.</a>

to:

<a href="http://www.fullframefest.org" target="_new">web
                              site.</a>


Also,
I notice you have the Javascript function function MM_preloadImages() on the page twice.  You only want it once.

I hope this helps!
0
 

Author Comment

by:sabrina718
ID: 8137648
brilliant!  thank you so much!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month8 days, 3 hours left to enroll

765 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