HTML - Open In New Windows.
Hey 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 Similar TutorialsI'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. *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 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 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 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> 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> 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??? 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 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 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. 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 I am trying to create a pop-up window from a link that is within an inline frame. I know the code I am using is correct as when I place the link outside of the inline frame, it works perfectly. It is when the link is placed within the inline frame that it acts up - it opens itself like a regular link within the frame (except that all my pages have frame break on them so it just works to open the page within the same window). This is the code I am using for the frame in my head section... <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=1000,height=700,scrollbars=no'); return false; } //--> </SCRIPT> and this is the script I am using for the link itself... <A hREF="news.html" onClick="return popup(this, 'notes')"><img align="right" src="news.jpg" border=0></A> This is my website I'm testing this on: www.kingsfieldfarm.net/index3.html The lower link (outside of the inline frame) works. The link inside the frame does not. Can anyone help me? Thanks! (and PS: Does anyone know how to centre the pop up window and get rid of the address bar?) Thanks for the help! Hi. My website is http://scissorhands.50megs.com It's just an old personal website that I don't really update very often. But, I can't figure out why it's not working the way it used to work. It used to have a narrow, vertical part on the left side, which was a navigation bar (with choices to click on) and the right was aa much bigger window that took up most of the page and it would change when you clicked on the left side. The left is supposed to stay the same. But now it's gone all crazy! The part that says "Welcome" is supposed to be in a big window on the right side and the links that say "About Me," "Things I've Written," etc... should be in the narrow window on the left that doesn't change. Would someone please help me put it back to how it used to be? Thanks. Scissorhands Hello, I'm a new web designed building my first web page. I'm using Dreamweaver CS 3. I want to make certain links open in a new window or tab when the user clicks on them, and in Dreamweaver I thought this was done by adding the _top target to the link, but that seems to do nothing. So how do I do this? Website Address: http://taras.shacknet.nu/~public1/plpp/ Thank you! Hi I tried embedding windows media player normally, to play videos on my site. It works on this computer (after i downloaded the rite codecs), but it doesent work on my other pc, nor mac. Is there anything you guys know that i can get (maybe some sort of php thing, or some other code) to use windows media player, or something so that when i embedd it to the site, it works with no problmes. I tried some flash things, but there all so confusing, and im not good at flash, so i get lost in it. Thanks.. Ive had this code before back when I was in school. It simulated the windows start bar in the explorer where if you clicked the start button a list of directories came up and you could select a htm file within that was linked in it...and it would have a tab in the bottom next to that start button that would allow you to switch between them like tabs essentially. I was wondering if anyone happened to have that code by chance its been a long time and I couldn't seem to find it by searching. Thanks in Advance 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 |