HTML - Open Multiple Windows
I'm trying to make a website for personal use that will open multiple search engines with one keyword search. I'm not quite sure how to have a text-field input the suggested keyword in the search query portion of the html code. Here's what I have so far:
<html> <head> <script type="text/javascript"> function open_win() { window.open("http://search.yahoo.com/search?p=asdf&fr=yfp-t-501&toggle=1&cop=mss&ei=UTF-8") window.open("http://www.google.com/search?hl=en&q=asdf&btnG=Google+Search&aq=f&oq=") } </script> </head> <body> <form> <input type=button value="Open Windows" onclick="open_win()"> </form> </body> </html> What I'm trying to do is replace the "asdf" portion of the code in both the yahoo and the google search parameters to something from an <input type=text> form. If anyone has any suggestions, I would greatly appreciate it. Similar TutorialsHey guys. One of my pages is full of hundreads of pictures. When you click them in makes them bigger, but it makes them bigger on the same page. Does anyone have anything that can make any link that is clicked on that page open in a new window. Heres the site. www.jimandanne.net/pictures.htm help would be great, Thanks *please bear with me this is a simple problem which is sort of hard to explain* I run a very small (15 page) website for myself. The site consists of an image_list page, which is an index of 13 thumbnail images. Each thumbnail links to a single page, each page being a larger image of the respective thumbnail. These 13 individual pages are directed at the same base target window, _ximage. you can find the image_list window he http://www.winslowsmith.com/work/index.html click on any one of these thumbnail links and a new window (_ximage) will open. navigate back to the image_list and click another link, the _ximage window will reload with the new page. Pretty simple, right?, just a <base target=""> command. In safari this all looks swell, and the _ximage window, whether open or not, will always come to the foreground to load. Not the case in Firefox. My problem in Firefox is as follows: opening one of the given links in image_list will load a new window (or tab), with _ximage target, and the first time, that new window/tab with _ximage target will come to focus and be in the foreground. However, if the viewer leaves the _ximage window open, and navigates back to the image_list window and clicks another link, that link will load appropriately but the _ximage window will remain in the background. (and it works the same whether you are using windows or tabs to load your new pages). This is frustrating because it forces the viewer to click twice rather than just once to get to one of these 13 pages, and said pages are the reason people would traffic to the site. Is there any way to have the links to base (_ximage) target always load in the foreground in Firefox(even when the target window _ximage is open)? Is there code to tell the Firefox browser, hey this is an important window load it in the foreground? Is there a way to do it with anchors? any help is appreciated Hi, I have a text link, when a user clicks it, I want multiple URLs to open in a new tab/window. I guess it's a javascript solution, yea? After searching the net for 30 mins I can't find anything. Thx in adv My page loads correctly, but when I open a new tab in IE7 so the tab bar appears, my page shifts to the left, and the menu overlaps/ obscures parts of the images. I can't find a reason why this happens, can anyone help? A screenshot of the error can be found below: http://www.onetopsoccer.com/error.jpg The page itself is at http://www.onetopsoccer.com/index.shtml I have a pdf file that is the catalog for my business. Is there a way to make it so that i can create a link that says "view" and if people click on it, then the standard "FILE DOWNLOAD" box does not come up... and it just opens the file in a separate window.... and have a "download" link where if they click that... then it just downloads the file. I know that i am weird... but i think it would be something that not everybody has... and something that would be kinda cool. Thanks in advance.... Mark I have to write a html code where i have to jump to 2 urls on click a object. presently i have written a code to jump to one url only "<a href=\"http://bodev:8080/OpenDocument/opendoc/openDocument.jsp?iDocID=AdknCqrhpYZKkFBzpe1wbsU&sIDType=CUID&sType=wid&sRefresh=N&sWindow=New\" title=\"\" target=\"_self\" nav=\"doc\">"+"Click State"+"</a>" When I click the object with text Click State, a new window pops ups with url. So, the requirement is now to pop open 2 windows when i click Click state The first url is as above and the second code is "<a href=\"http://bodev:8080/OpenDocument/opendoc/openDocument.jsp?iDocID=AYhtqwsujalMpBHSjfT0hF0&sIDType=CUID&sType=wid&sRefresh=N&sWindow=New\" title=\"\" target=\"_self\" nav=\"doc\">"+[State]+"</a>" Note: My program embeds these codes, so i need to use <a href> and </a> Hey there, I'm trying to code my site for not only IE8 but also IE6/7 versions. I can't seem to figure out how to download the earlier versions without either getting rid of IE8 or just not being able to download them. Is it possible for me to have IE6, 7, and 8 on one computer? Thanks, ~C-Style~ Hi all, newbie here. I'm trying to make an "interactive" music video where a user clicks images which trigger pop up windows playing youtuve videos to appear. My problem is keeping the pop up youtube videos "on top" while retaining the user's ability to click on the interface of the original webpage (to trigger more videos). any ideas? Any help would be greatly appreciated. thanks in advance hi guys, I am new here and my friend says he always gets help when he comes on this forum so I will follow in his foot steps. My problem is this; I am building my website and I have come up to a wall. I have 4 different playlist that I want to come out on a pop up window which I already configured and all but I can't seem to get my links to open in the same pop up window. I want to be able to click on a link and it opens it in the same pop up that is already there. Is that possible. This is the code that I am using: <p>These are our current playlists:</p> <blockquote> <p><a href='media/gospel playlist/gospel player.html' target="_blank" onClick="window.open('media/gospel playlist/gospel player.html', '', 'scrollbars=auto, menubar=no, height=500, width=400, resizable=no, toolbar=no, location=no, status=no'); return false;">GOSPEL</a></p> <p><a href='media/hiphop playlist/hiphop player.html' target="_blank" onClick="window.open('media/hiphop playlist/hiphop player.html', '', 'scrollbars=auto, menubar=no, height=500, width=400, resizable=no, toolbar=no, location=no, status=no'); return false;">HIPHOP - R&B - REGGAE</a></p> <p><a href='media/zouk playlist/zouk player.html' target="_blank" onClick="window.open('media/zouk playlist/zouk player.html', '', 'scrollbars=auto, menubar=no, height=500, width=400, resizable=no, toolbar=no, location=no, status=no'); return false;">ZOUK - KONPA - LATIN</a></p> <p><a href='media/jazz playlist/jazz player.html' target="_self" onClick="window.open('media/jazz playlist/jazz player.html', '', 'scrollbars=auto, menubar=no, height=500, width=400, resizable=no, toolbar=no, location=no, status=no'); return false;">LOVE SONGS - JAZZ - BLUES</a></p> <p> </p> </blockquote> Pleas help out if possible.. Thanks a bunch Hello! I am in need of some assistance with pop-up windows... Thisis an example of the code I am currently using for pop-up windows (below), it opens a new window that displays an image and it works great!... Only now I require the same format (including the text underneath), only instead of having the pop-up windows display images, I need them to display a body of text in html format.... Can anyone please assist me with this? Thank you!!! <center><html> <head> <style type="text/css"> div.img { margin:2px; border:0px solid #0000ff; height:auto; width:auto; float:left; text-align:center; } div.img img { display:inline; margin:3px; border:1px solid #ffffff; } div.img a:hover img { border:1px solid #0000ff; } div.desc { text-align:center; font-weight:normal; width:120px; margin:2px; } </style> </head> <body> <div class="img"> <a target="_blank" href="klematis_big.htm"> <img src="klematis_small.jpg" alt="Klematis" width="200" height="150" /> </a> <div class="desc">Add a description of the image here</div> </div> <div class="img"> <a target="_blank" href="klematis_big.htm"> <img src="klematis_small.jpg" alt="Klematis" width="200" height="150" /> </a> <div class="desc">Add a description of the image here</div> </div> <div class="img"> <a target="_blank" href="klematis_big.htm"> <img src="klematis_small.jpg" alt="Klematis" width="200" height="150" /> </a> <div class="desc">Add a description of the image here</div> </div> </body> </html> Hi, Wonder if you can help please. I have a long established ASP page called carkeys.asp - which does not work on my new Linux hosting (whoops should have know that). Before I change back to a windows platform is there anyway this page can be bounced to the replacement page at carkeys.html? The .asp page is well ranked with google and I would like its statistics to be directed to the new html page. I have code for the re-direction, but the page cannot be viewed to get this far. http://www.lockcity.co.uk/carkeys.asp > http://www.lockcity.co.uk/carkeys.html Many thanks for any help you can give Abi Popup Windows: The Basics We'll begin the tutorial by creating a basic popup window. The technique described here addresses all the major issues in popups. The popup always comes to the front. Different links can target the same popup. The code is simple and easily modified. Everything for the rest of the turorial is a variation on the theme described here. The code in this page creates a popup that is opened from a link. In this section we'll show the code with just the minimal description you need to get it going. First, copy this script into the <HEAD> section of your page: HTML Code: <SCRIPT TYPE="text/javascript"> <!-- function popup(mylink, windowname) { if (! window.focus)return true; var href; if (typeof(mylink) == 'string') href=mylink; else href=mylink.href; window.open(href, windowname, 'width=400,height=200,scrollbars=yes'); return false; } //--> </SCRIPT> For now we'll skip the details of how the script works, and move to the next step. The script above opens the popup, but something needs to run the script. The most common situation is that the script is run when the user clicks on a link. A link like the following would run the script: HTML Code: <A HREF="popupbasic.html" onClick="return popup(this, 'notes')">my popup</A> Most of the link is as usual. The URL of the page being linked to is in the HREF attribute. We've added an additional attribute called onClick. Copy the code as it is into your link, with only a small modification. The second argument of the popup() -- 'notes' -- indicates name of the popup window. Every popup window should have its own unique name. Be sure to put the name in single quotes (''). So if you want to name the popup 'stevie' then this would be the code: HTML Code: <A HREF="popupbasic.html" onClick="return popup(this, 'stevie')">my popup</A> Read This Next Part Or You'll Go Insane Trying to Figure Out Why Your Popup Doesn't Work A small but crucial point is often overlooked. The command in onClick must begin with return or the script won't work. Be sure to start the command with return like this: HTML Code: onClick="return popup(this, 'notes')" And don't put a space in the page name between the single quotes. If you do, the link will act just like a regular link. Popup Windows: From an Image Map In our first variation we'll open the popup from an image map instead of from a regular anchor. We'll use the same script as from our first example. With that script, an <AREA ...> tag in an image map can be made to open a popup in exactly the same way as an <A ...> tag: HTML Code: <MAP NAME="index"> <AREA HREF="mypopup.html" ALT="My Popup" COORDS="10,10,120,120" SHAPE=RECT onClick="return popup(this, 'gloss')"> <AREA SHAPE=RECT ALT="Your Popup" COORDS="140,10,180,50" HREF="yourpopup.html" onClick="return popup(this, 'gloss')"> <AREA SHAPE=DEFAULT NOHREF> </MAP> <IMG SRC="mymap.gif" HEIGHT=130 WIDTH=190 ALT="Image Map Example" BORDER="0" USEMAP="#index"> Popup Windows: Opening Automatically In the first two examples (Popup Windows: The Basics and Popup Windows: From an Image Map) the popup is opened when the user clicks on something. In this example the popup opens automatically. We'll use the same script as in the first example. Copy this script in the <HEAD> section of your page: HTML Code: <SCRIPT TYPE="text/javascript"> <!-- function popup(mylink, windowname) { if (! window.focus)return true; var href; if (typeof(mylink) == 'string') href=mylink; else href=mylink.href; window.open(href, windowname, 'width=400,height=200,scrollbars=yes'); return false; } //--> </SCRIPT> This time, instead of running the script from a link we'll run it from the onLoad attribute of the <BODY ...> tag. HTML Code: <BODY onLoad="popup('autopopup.html', 'ad')"> The command in onLoad is run when the document is finished loading. Like in our previous example, the command runs popup(), but this time the first argument for popup() is a little different. In the previous example we put this, meaning the link itself, and the script got the URL from the link. In this case there is no link so we pass the actual URL to open. So in our example we put 'autopopup.html'. Popup Windows: From a Form For our next variation on the popup theme we're going to open the popup from a form. In this example we're going to change the script around. The following script is custom designed for opening a popup from a form. It works with forms that use both POST and GET. Copy the following script exactly as-is into the <HEAD> section of your document: HTML Code: <SCRIPT TYPE="text/javascript"> <!-- function popupform(myform, windowname) { if (! window.focus)return true; window.open('', windowname, 'height=200,width=400,scrollbars=yes'); myform.target=windowname; return true; } //--> </SCRIPT> Now we'll add some code so that the popup opens when the user submits the form. Add an onSubmit attribute to <FORM ...> tag: HTML Code: <FORM METHOD=POST ACTION="../cgi-bin/mypopupcgi.pl" onSubmit="popupform(this, 'join')"> The first argument for popupform() is always this, meaning the form itself. The second argument, 'join' in this case, is a unique name for the popup. Popup Windows: Targeting the Opener Once a popup window has been created, linking from the popup back to the main window (i.e. the window which opened the popup) is a little trickier than might be expected. The problem is that the main window doesn't have a "name" the way the popup window does. Fortunately, JavaScript provides an answer in the form of opener. To create links in the popup window that target back to the main window, first put this JavaScript in the <HEAD> of the popup page: HTML Code: <SCRIPT TYPE="text/javascript"> <!-- function targetopener(mylink, closeme, closeonly) { if (! (window.focus && window.opener))return true; window.opener.focus(); if (! closeonly)window.opener.location.href=mylink.href; if (closeme)window.close(); return false; } //--> </SCRIPT> A link that uses this script looks like this: HTML Code: <A HREF="rbex.html" onClick="return targetopener(this)">my page</A> Popup Windows: Closing When They Go to the Opener In the previous example the link in the popup targets the main page, but the popup stays open in the background after the user clicks on the link. In this page we'll set the link so that it closes the popup after the click. targetopener takes three parameters. The first is always this, meaning the link itself. The second and third parameters are optional and default to false. (Notice we don't use them in the example above, we'll get to them shortly.) The second parameter indicates if the popup should close. The third is if the link should actually send the opener to the linked resource, or if the opener should just get the focus regardless of what its current page is. The third parameter provides a safe way to close the popup after closing, but still having a link to an existing page if the window isn't actually a popup (such as if the user found the page through a search engine). When the user clicks on the link, targetopener checks if the browser has the focus command (a few older browsers don't) and if the current window was opened by another window. If these conditions are true, then the opener window gets the focus, the opener is directed to the referenced URL, and the script returns false. Because the function returns false, the link does not go on to the URL (the script has already done that). Note that the link which targets the opener is a little different than the link that opened the popup window to begin with. In this link, onClick says "return goOpener(this)"... the links on the previous pages did not use return. By default, the popup window stays open but is in the background. If you want the popup to close after going back to the opener, add a second parameter of true to the targetopener function call: HTML Code: <A HREF="rbex.html" onClick="return targetopener(this,true)">main page</A> Hi. I'm trying to replicate an old app that used to be in the App Store. It let you log into xbox.com, and take your friends list and various other info, and put a nice interface over it. Right now I'm having real trouble even logging into xbox.com, or live.login.com. You can see my webapp here. For some reason it doesn't work. I even tried using all the HTML which doesn't seem to work either. Does anybody know how to fix this, OR another way to login to xbox.com to get the info. Thanks. I have been working on this thing forever!! I am in desperate need of help!! I currently am running an HTA file called h1.hta and I want to be able to open another HTA called h2.hta that will take in parameters and close the current HTA. I am using this snippet of code to open the new h2.hta(parameters) within my current h1.hta : nextpage = h2.hta?trial=2&condition=1 //vbscript set WshShell = CreateObject("WScript.Shell") WshShell.Run(nextpage) When I run this, I get a "File not Found" error. I believe it's because the file in the system is entitled h2.hta and when i send it with the parameters, it does not recognize. My question is how do I go to another hta file with parameters??? Thanks for the help! I had this question for anyone in this forum who has time. I am attempting to make a pop-up menu in dreamweaver and have done everythign as correctly as I can, yet no pop-up menu appears... what am I doing wrong? I have made them in exactly the same fashion before and they worked fine... any ideas? I've added the mm_menu.js file to my main server space. http://www.skyjacobs.com/favorites-page2.html This is where it should pop-up on the left 'photography' button... page 1, page 2, etc. 'View source code' if that helps. Thanks for anyones assistance. Desierto I have hit yet another snag in my website development quest. When you switch from using a Mac program to a Windows program (for looking at your html) your code seem to get condensed. To put that into better words: your returns are not returns anymore, but funky looking boxes. Normally I would not care about this, since Windows is not frequently used in my house, but alas this site is being developed for a Windows user. Anyways, I have tried a few solutions, all to no avail. These attempts went in this particular order: turn off all text edit preferences that could be causing the problem (rich text stuff), then turn on all the rich text stuff (stupid idea I know...), then finally to try saving the file from Dreamweaver. Any help is very much appreciated, Hello, I have embedded Windows Media Player on this one page I have that streams a live weather radio feed I have here in my Office. In FF it works fine but the player does not work in IE. Here is the URL http://www.mesquitechristmas.com/wea...stmas&state=tx Here is the code for the player that I have embedded. HTML Code: <script language="JavaScript" type="text/javascript"> embedFeed("","http://audiostream.wunderground.com/MesquiteChristmas/DFW.mp3.m3u"); </script> <div align="center"><object height="40" width="200"><param name="type" value="application/x-mplayer2"><param name="src" value="http://audiostream.wunderground.com/MesquiteChristmas/DFW.mp3.m3u"><param name="autostart" value="1"><param name="showcontrols" value="1"><param name="showstatusbar" value="1"><embed src="http://audiostream.wunderground.com/MesquiteChristmas/DFW.mp3.m3u" type="application/x-mplayer2" autoplay="true" autostart="1" controller="1" showstatusbar="true" bgcolor="#FFFFFF" height="69" width="280"></object></div><noscript><br>Your browser does not have javascript enabled and can not use the embedded player.<br>You will need to <a href="http://audiostream.wunderground.com/MesquiteChristmas/DFW.mp3.m3u">click here</a> to listen to this stream using your default audio player.<br></noscript> Here is the Js script for it. HTML Code: // Batmosphere Embedded Media Player, version 2006-05-31 // Written by David Battino, www.batmosphere.com // OK to use if this notice is included // This function reads an MP3 URL and title from the referring page and generates embedding code to play back the audio file. // Windows browsers (except for Internet Explorer) will play back the file with the Windows Media Player *plugin.* Internet Explorer will use Windows Media Player. // Non-Windows browsers will play back the file with their standard audio handler for the MIME type audio/mpeg. On Macs, that handler will usually be QuickTime. var audioFolder = ""; // If you have a default audio directory, e.g., http://www.your-media-hosting-site.com/sounds/, you can put it here to make links on the referring page shorter. function embedFeed(MP3title,MP3URL) { // Get Operating System var isWin = navigator.userAgent.toLowerCase().indexOf("windows") != -1; if (isWin) { // Use MIME type application/x-mplayer2 visitorOS="Windows"; } else { // Use MIME type audio/mpeg, audio/x-wav, etc. visitorOS="Other"; } var audioURL = audioFolder + MP3URL; var objTypeTag = "application/x-mplayer2"; // The MIME type to load the WMP plugin in non-IE browsers on Windows if (visitorOS != "Windows") { objTypeTag = "audio/mpeg"}; // The MIME type for Macs and Linux document.write('<div>'); document.write('<strong style="font-size:18px; position:relative; top:-28px">' + MP3title + ' </strong>'); // Adjust font style to taste document.write('<object width="280" height="69">'); // Width is the WMP minimum. Height = 45 (WMP controls) + 24 (WMP status bar) document.write('<param name="type" value="' + objTypeTag + '">'); document.write('<param name="src" value="' + audioURL + '">'); document.write('<param name="autostart" value="1">'); document.write('<param name="showcontrols" value="1">'); document.write('<param name="showstatusbar" value="1">'); document.write('<embed src ="' + audioURL + '" type="' + objTypeTag + '" autoplay="true" autostart="1" width="280" height="69" controller="1" showstatusbar="true" bgcolor="#000000"></embed>'); // Firefox and Opera Win require both autostart and autoplay document.write('</object>'); document.write('</div>'); document.close(); // Finalizes the document } Any idea what might be causing this? -Thanks Hello, How do we keep on open the link(here it is HTML Form) in new window. I tried the target="_blank". At first time when i click the link, it opens the HTML form in the new window, but if i click the link next time, the same HTML form(already opened) got refreshed. Is it any way to open the HTML forms in different windows whenever i click the link. Regards, Manimaran |