JavaScript - Targeting Frames In Pop-up Windows
This seems like it would be so simple and I have absolutely no idea.
I have one page with no frames, and two links on it. The second page has an iframe on it. Both links on page 1 point to page 2 (which houses the iframe), but based on which link is clicked will determine what that iframe will display. Basically I need to figure out a way to target the iframe on page 2 after executing a window.open statement. Much like how google images creates a frame at the top after you click on one of the images from the search results. I've attached two simple files to better explain what I'm trying to do. FrameSet.zip I'd appreciate the help, I'm losing my mind. Similar TutorialsCan someone teel me what I need to do to target the links to frames? <!doctype html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Tree View</title> <link rel="stylesheet" type="text/css" href="css/multi/tree.css"> <script type="text/javascript" src="build/yahoo.js" ></script> <script type="text/javascript" src="build/event.js"></script> <script type="text/javascript" src="build/treeview.js" ></script> <script type="text/javascript" src="build/jktreeview.js" ></script> <!-- Below is Style sheet for demos. Removed if desired --> <style type="text/css"> body {font: normal 11px verdana, sans-serif; color: #333; line-height: 19px;} a { text-decoration: underline; color: #46546C; } a:hover { text-decoration: underline; color: #4d77c3; } #tree1 {width:250px;padding: 10px;float:left;} #tree2 {width:250px;padding: 10px;float:left;} #tree3 {width:250px;padding: 10px;float:left;} </style> </head> <body> <h2>Folding TreeView Menu demo: <a href="http://www.javascriptkit.com/script/treeview/">More info</a></h2> <!--Empty DIV tags to contain the treeview demos --> <div id="tree1"></div> <div id="tree2"></div> <div id="tree3" class="treemenu"></div> <script type="text/javascript"> var palmtree=new jktreeview("tree3") palmtree.addItem("Coding Forums", "", "http://www.codingforums.com") palmtree.addItem("PHP Reference", "", "http://www.php.net") palmtree.addItem("Mozilla Dev Center", "", "http://developer.mozilla.org/en/docs/Main_Page") var branch4=palmtree.addItem("CSS Drive") //A TREE BRANCH WITH NO URL FOR ITSELF palmtree.addItem("CSS Gallery", branch4, "http://www.cssdrive.com") //Add this item to branch4 palmtree.addItem("Web Design News", branch4, "http://www.cssdrive.com/index.php/news/") //Add this item to branch3 palmtree.addItem("CSS Compressor", branch4, "http://www.cssdrive.com/index.php/main/csscompressor/") //Add this item to branch3 palmtree.addItem("Ajaxian", "", "http://ajaxian.com/") palmtree.treetop.draw(); //REQUIRED LINE: Initalize tree </script> </body> </html> Hi, I have 2 groups of ads, 6 banners with different languages in each group. The only difference between those groups is the color. All 12 banners has the same size. I want to know how can I do Geo Targeting for those two groups. And how can I seperate each group with a tracking link that will tell me which color converts better. Will appreciate also a good resourse to learn from - website, tutorial, guide... Many thanks. Hello, I've been spending sometime on this project now I had a few PHP problem but have got them resolved. The one problem that I'm currently having is setting the target for a image upload form to send the data to another page so that the page never actually refreshes. I got this working just fine on Google Chrome, Firefox and so on but in internet explorer this is still a problem. Whenever you click submit to start the uploading of the picture it pops up a new window to the upload.php page that PHP script runs on. Its not suppose to do that, it is just suppose to run in the background and upload normally without any window popping up. I don't understand why it is doing this, I've seen other scripts do the same thing that I'm doing here but mine for some reason mine isn't working correctly in internet explorer. Maybe you guys can give me idea to what is wrong with this. Code: function showPhotoUpload() { //Apply the the black transparent background var overlay = document.createElement("div"); overlay.setAttribute("id","overlay"); overlay.style.cssText="z-index:3; background:#111111; min-width:100%; min-height:100%; max-height:120%; max-width:120%; position:absolute; top:0; opacity:0.5; filter:alpha(opacity:50);"; document.body.appendChild(overlay).lastChild; //Append the photo container var photoContainer = document.createElement("div"); photoContainer.style.cssText="z-index:4; background:#f1f1f1; width:400px; height:240px; overflow:hidden; position:absolute; top:20%; left:35%;"; photoContainer.setAttribute("id","photoContainer"); photoContainer.innerHTML = "<div id=\"photo-opt\">Please select a image file from your computer: <a href=\"javascript:;\" onclick=\"closePhotoUpload();\">Close</a><div id=\"file-upload\"><form method=\"post\" id=\"photo-upload\" action=\"upload.php\" enctype=\"multipart/form-data\"><input name=\"photo\" type=\"file\" /><input name=\"submit\" type=\"submit\" value=\"Upload\" /></form></div><div id=\"loading\"></div></div"; document.body.appendChild(photoContainer).lastChild; pushData(); } function createIframe() { var iframe = document.createElement("iframe"); iframe.setAttribute("width","0"); iframe.setAttribute("height","0"); iframe.setAttribute("name","upload_target"); iframe.setAttribute("src",""); iframe.setAttribute("style","width:0px; height:0px; border:0;"); iframe.setAttribute("id","upload_target"); document.body.appendChild(iframe); } function pushData() { document.getElementById('photo-upload').onsubmit=function() { createIframe(); document.forms[1].target = 'upload_target'; //'upload_target' is the name of the iframe setTimeout("document.body.removeChild(document.getElementById('upload_target'))", 250); } } function closePhotoUpload() { var photoContainer = _('photoContainer'); var overlay = _('overlay'); document.body.removeChild(photoContainer); document.body.removeChild(overlay); } The ones that need to be focused on the most is the createIframe() and pushData(). Those are the two that are suppose to do the magic. The pushData() function gets called in the showPhotoUpload() function. Thanks for the help. Hi all Ive basically 3 php scripts: -one that writes an xml file from a directory of image files -one that creates a thumbnail from a jpeg file resizes it and puts a little drop shadow on the thumbnail -one that reads the xml file and outputs the html code so all is good a little old school, but it works, I get a page of thumbnails in whatever form I want with links. Ive attached a lightbox script I found to open the thumbnails and thats ok. What I would like to do is target the images to a container inside a div tag using jquery, maybe even fade the image in something fancy. but Id be happy with the basics. Just click on the thumbnail show it in the adjacent container. (dont have a container yet thats what i need some help with with) I'm doing my best going through various tutorials and the chm file learning as I go here is the test page that outputs the thumbnails: http://www.eagleview.ca/newsite/cont...om=0&pageto=12 any help is appreciated william Hi Guys i wonder if any one would be able to do this, i know its a hard one! Im wanting to use the following site but rather than copy pasting links (like they ask you to) i would rather use a script to grab the link and echo it for me. The reason being i think embedding they channels the offer would be far easier. So heres the challenge: The target is the stream url at the bottom of this page: http://www.zapni.tv/play.php?id=100 (looks like this Code: http://www.zapni.tv/stream/vlc.php?id=100&session=NTEzNjcwMzY2OQ==&stream=play ) the aim is to be able to write it into a player on page load like this: Code: <embed type="application/x-vlc-plugin" name="VLC" autoplay="yes" loop="no" volume="100" width="640" height="480" target="http://www.zapni.tv/stream/vlc.php?id=100&session=MTk3NjYwODUzOQ==&stream=play"> Cheers Guys in advance, and good luck! BTW i only hope Javascript is the correct category if not, sorry :-) Hello I would like some help. The ebay editor kit produces code that is in javascript format. Is it possible to edit that javascript so it is IP geo targeted. Meaning that the javascript will show ads from the ebay site of the visitors country? I was reading the Ebay Partners Network blog and it stated it can be done using third party scripts and geoip database. If this can be done by php then any advice would be very greatfull. Thanks all in advance. -Removed due to solution found-
Hello! I'm trying to make a website that from one link, opens multiple windows. It is for a design project (I'm still at uni). So far I have mustered just the one window. Here is the website: http://popmeup.org/ The idea is that you get bombarded with lots of nice quotes. I don't know my arse from my Javascript - but has anyone got any advice? I thought I did everything right but pop-up windows aren't working... Code: <td> <a href="javascript:popUp('http://www.retrocitysunglasses.com/popupfreeshipping.html')"><img src="http://www.retrocitysunglasses.com/website_graphics/header_free_shipping.jpg" alt="Free Shipping"></a> </td> Code can be found on this page (very first section after body opens): http://retrocitysunglasses.com/ You can see the website here with all the code to make it easier for you to diagnose what is happening: Code: http://www.fdfdaa.com/desktop/desktop.html When you go to the start menu and select anything on the left side, you will see that windows open 100% of the screen by default. I did that by adding maximized:true but that doesn't appear to be working for the icons on the desktop itself. If you click on one of those 4 icons on the desktop though, it isn't opening at 100% for some reason. You can see my classes file here as well: Code: http://www.fdfdaa.com/desktop/classes.js Any help will be greatly appreciated. Thank you for your time! Hi. I don't know if anyone here has downloaded the dev edition of windows 8 yet (it was released last night 5:00p, est) I am trying to get jquery to work, but it just wont... I tried simple stuff, but I was hoping someone here knew how. Thanks This is my first time writing any JavaScript, so I am not very familiar with the language. I want to make a window be kept at the back, under all other windows. From what I understand, the method to do this would be window.blur(), but I cannot seem to get it to work. Have I misunderstood the functionality, or am I implementing it wrong? The part of the code I have that currently deals with this (or at least tries) is as follows: Code: <BODY onclick="window.blur()" > <img src="imageurl" id="image"></img> </BODY> I've tried a few other events to trigger this (onmouseover, setInterval, etc.) but no way I've tried has worked. So, is blur() the right method to do this? have I done something wrong in the implementation? Any help and guidance is appreciated. Backstory (if it should matter for some reason) : I found a webpage ( here and here ) that generates an image of the Earth as seen from space at a given time and I wanted to place that image, updated on a regular basis, as my desktop image. I looked around for a way to do it, but as far as I could find, there was no way to do it easily in Windows XP. Thus, I am now using Samurize (a program for overlaying graphics etc. at your desktop) to create a browser window that loads a html file that periodically updates the image. While this window cannot be moved and has no borders, it can be selected and if it is selected, the image is brought to the front, overlapping any other windows. I wish to make it such that this cannot happen; I have tried configuring Samurize as well as asking for help on their forums, but no luck so far. I have searched high and low to find this script. Not having much luck at all. What i want to do is, when someone clicks a link the image pops up on screen in its own nice window smack down in the middle of the screen over top of the website. I want it to look neat tho, best example i can find is @ curse.com http://wow.curse.com/downloads/wow-a...st-helper.aspx If you click that link and scroll down to the screen shot section and click on one of the images you can see how nice and professional it looks. How can i accomplish this? Thanks so much in advance~ Hi, I need javascript to sort as windows sorts its file. For eg: When the files name contains special characters, number and alphabets(#@!$%.doc, test1.doc,test2.doc, 1.doc) javascript sorts alphabets first and then special characters, but windows sorts special characters first and then alphabets in ascending. I want javascript to sort my array as windows. Kindly help me out in this case. Thanks, Deva. In the past I write the jave script to popup windows in the browser for tell our visitor about news & event but now most of browser will block popup by default. Someone can show me an example about the professional popup with out the block.Thank you
Ok I need to open a popup in a second monitor. The browser will be open in the first monitor and the popup needs to open in the second monitor (we'll say it's to the left for now). I have tried a few Javascript methods. I don't have PHP avaliable to me in this case but I do have the ability to use JSP and will shortly have JQuery. Here is what I have tried so far: Code: <script type="text/javascript"> function popup(url, winName, xOffset, yOffset) { var x = (window.screenX || window.screenLeft || 0) + (xOffset || 0); var y = (window.screenY || window.screenTop || 0) + (yOffset || 0); return window.open(url, winName, 'top=' +y+ ',left=' +x); } </script> <form> <input type="button" onClick="popup('http://www.google.com', 'myWin', -600, 100)" value="Show Customer"/> </form> and Code: <script type="text/javascript"> function popup() { window.open( "http://igatedev.kirbyrisk.com/DualMonitorTest/product.jsp?part=545347", "myWindow", "status=0, fullscreen=0, resizable=1" ) } </script> Any help is much appreciated. Also I was wondering if there was a way to have the popup close with the original window, or with a button click from the first. This is a pet peeve of mine and I'm still looking for a solution. If I have designated a specific size dimension for a popup window to open with (as one must, otherwise why even use a pop-up window?) then it should be obvious that the window needs to open up at 100% (normal) magnification, otherwise the contents of the window will not be displayed properly. It seems to me current browsers are struggling with this problem, as Firefox, Safari, and Opera all handle it differently. For example, Firefox applies magnification settings defined by the user to dimensions of the pop-up window but not to the contents (an odd solution!); Opera retains the correct dimensions but applies magnification to the contents. Only Safari handles it correctly: even if you have applied magnification to a web page it will still open pop-up windows at default 100% magnification and honor the dimensions specified in the HTML code by the page designer. Thanks for any help you can provide. Hi everyone, I'm trying to capture the order in which the windows I've opened using window.open are layered on top of each other. For example, if I open three windows, starting with the first on the bottom and the third on top, but I then focus on the second window, bringing it to the top, is there a way to capture the new window order (2 on top, then 3, then 1)? I know that window.top can give me the first one, but from there, without closing it, is there a way to tell what the next one underneath it is? Thanks in advance, Katherine Hi, I'm trying to make a pop up window that should work such as the window the pops up when you press "View all friends" on one of your friends' profiles on Facebook. Is this possible? Thank you! Hi Guys, I want to develop a javascript code which will open a pop up window and a JSP page in it. That JSP page will load a 'Select' list which user will select a value from and I want that value to be returned to my parent form (window). I remember implementing the same long time back (almost 5years now) ...can anyway help remind me how did I do it...or how can I do it? Regards, -- SJunejo |