Jump to content

Recommended Posts

Posted

Hi!

 

Just wondering if someone can tell me where in my code I can set the target URL to open in a new browser window. I tried changing 'parent' to '_blank' but that didn't work.

 

Here is the code:

><form name="dd_form" target="_blank" id="dd_form">
             <select name="Digital Downloads" onChange="MM_jumpMenu('parent',this,0)">
               <option value="#" selected>SELECT A STORE</option>
               <option value="#">_______________</option>
               <option value="http://www.buy.com/retail/searchResults.aspx?searchquery=Natalie%20Brown&queryType=music_artist&skdbg=12&search_store=6&loc=18250">Buy.com</option>
               <option value="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?playlistId=4365413">iTunes (Must Be Installed)</option>
               <option value="http://music.msn.com/search/all/?ss=natalie+brown">MSN Music</option>
               <option value="http://www.listen.com/">Raphsody (Must Be Installed)</option>
               <option value="http://www.primetones.com/personalpage.asp?user=nataliebrown">Primetones</option>
               <option value="http://www.usasounds.com">USA/UK/OZ Sounds (Must Subscribe)</option>
               <option value="http://musicstore.real.com/music_store/album?artistid=2235&albumid=455783&filter=y&sort=rd&from=disc">Real.com (Must Be Installed)</option>
               <option value="http://online.musicmatch.com/mmzNav.cgi?params=navigate%3FARTISTID%3D747650%26DEST%3DDownload%26DID%3D">MusicMatch (Must Be Installed)</option>
               <option value="http://musicstore.connect.com/album/500/000/000/000/000/628/126/500000000000000628126.html?templateid=18-AlbumDetailAMG&pageBusiness=Connect&pageSite=musicstore.connect.com&pageDivision=Regular&pageCommerceType=Purchasable&pageCommerceId=500000000000000628126&pageLocale=en&pageTerritory=US&startRow=1">Sony Connect (Must Be Installed)</option>
               <option value="http://www.napster.com">Napster (Must Be Installed)</option>
                                                                     </select>
           </form>

 

The link is:

http://www.natalie-brown.com/ltcb.htm#dd

 

Thanks,

 

Nat

Posted

Hi Nat.

The problem is actually in the javascript function that is called when the selection changes. As written it is specifically telling the 'parent' window to navigate to a new 'location'. Try this:

 

><script type="text/javascript">
<!-- 
function jumpBlank(selObj) {
  eval("window.open('"+selObj.options[selObj.selectedIndex].value+"')");
  selObj.selectedIndex=0;
}
// -->
</script>

. . .

<select onchange="jumpBlank(this)">
  <option value="#" selected>SELECT A STORE</option>
  <option value="http://music.msn.com/search/all/?ss=natalie+brown">MSN Music</option>
</select>

 

Hope that helps.

Posted

Lisa- Jim was right about that previous JS code at the beginning of the HTML. I think your option works for drop down lists tho. Thanks for the line of code.

 

Worked like a charm Jim!

 

Thanks :unsure:

 

Hi Nat.

The problem is actually in the javascript function that is called when the selection changes. As written it is specifically telling the 'parent' window to navigate to a new 'location'. Try this:

 

><script type="text/javascript">
<!-- 
function jumpBlank(selObj) {
  eval("window.open('"+selObj.options[selObj.selectedIndex].value+"')");
  selObj.selectedIndex=0;
}
// -->
</script>

. . .

<select onchange="jumpBlank(this)">
  <option value="#" selected>SELECT A STORE</option>
  <option value="http://music.msn.com/search/all/?ss=natalie+brown">MSN Music</option>
</select>

 

Hope that helps.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...