open new browser window action

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

[Webinar] Streamline your web hosting managementRegister Today

x
 
WebDevAngConnect With a Mentor Commented:
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
 
WebDevAngCommented:
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
 
sabrina718Author Commented:
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
 
sabrina718Author Commented:
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
 
sabrina718Author Commented:
brilliant!  thank you so much!
0
All Courses

From novice to tech pro — start learning today.