| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Mar 2006 Location: Manchester
Posts: 418
![]() | Drop Down Menu - extra window This is code for one of my options on drop down menu <option value="/beta/amazon.html" onClick="MM_openBrWindow('http://www.amazon.co.uk/exec/obidos/redirect?link_code=ur2&tag=dvdrentalcomp-21&camp=1634&creative=6738&path=www.amazon.co.uk', 'merchant','toolbar=yes,location=yes,status=yes,me nubar=yes,scrollbars=yes,resizable=yes')"> ????: NamePros.com http://www.namepros.com/programming/214878-drop-down-menu-extra-window.html Amazon</option> , it works except a new window with the amazon link doesnt appear, anyone know why Basically i want the page to link to www.mysite.com/beta/amazon.html , and then another window to open with 'http://www.amazon.co.uk/exec/obidos/redirect?link_code=ur2&tag=dvdrentalcomp-21&camp=1634&creative=6738&path=www.amazon.co.uk' that in it What am i doing wrong ? |
| |
| | #2 (permalink) |
| Buy my domains. Join Date: Feb 2006
Posts: 2,796
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Code: <script type="text/javascript">
function openlinks(url1, title1, url2, title2) {
window.open(url1, title1, "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes");
window.open(url2, title2, "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes");
}
</script>
<option onclick="openlinks('http://google.com', 'Google', 'http://yahoo.com', 'Yahoo');">Open the Windows</option> |
| |
| | THREAD STARTER #3 (permalink) |
| NamePros Regular Join Date: Mar 2006 Location: Manchester
Posts: 418
![]() | does the script but (top bit) does that need to be in head at top, or anywhere ? ????: NamePros.com http://www.namepros.com/showthread.php?t=214878 I've done this and it don't seem to work, says error <script type="text/javascript"> function openlinks(url1, title1, url2, title2) { window.open(url1, title1, "menubar=yes,location=yes,resizable=yes,scrollbars = yes,status=yes"); window.open(url2, title2, "menubar=yes,location=yes,resizable=yes,scrollbars = yes,status=yes"); } </script> <div class="bar" style="width: 1051; height: 72"> <ul> <li class="browse_category"> <p>Search By Retailer: <select name="Retailer" onChange="location=this.options[this.selectedIndex].value;" id="search_box" style="font-family: Verdana"> <option value=# selected>Retailers A to H</option> <option onclick="openlinks('/beta/amazon.html', 'Amazon', 'http://www.google.com', 'google');">Amazon</option> |
| |
| | #4 (permalink) | ||||
| Senior Member Join Date: Dec 2004 Location: .co.uk
Posts: 2,243
![]() ![]() ![]() ![]() | I dont see why you dont just put the open window functions in to the link.. Its over complicating things? But I reccomend putting any functions in to the <head> ????: NamePros.com http://www.namepros.com/showthread.php?t=214878 But, for a start have:
__________________ :hi: | ||||
| |