Sponsor Message:
Non Aviation Forum
My Starred Topics | Profile | New Topic | Forum Index | Help | Search 
Javascript Help Anyone?  
User currently offlineSingapore_Air From United Kingdom, joined Nov 2000, 13738 posts, RR: 19
Posted (6 years 7 months 2 weeks 4 days 23 hours ago) and read 837 times:

Greetings and Salutations,

I have the following code which I extracted from somewhere else. I want it to target an IFrame called "Manchester" for example but after pouring through a few IFRAME guides on the internet, notably http://lab.artlung.com/dropdown, I can't get it to target the Iframe.

Any help would be appreciated.




//alert(strURL);
//window.navigate(strURL);
//window.open(strURL,'1ARES','location,menubar,resizable,dependent,status,ValueWidth=800,Height=600,location,toolbar');
screenW=screenW-10;
screenH=screenH-160;

//window.open(strURL,'1ARES', ' menubar,resizable,status,location,scrollbars,toolbar,left=0,top=0,width=' + screenW + ',height=' + screenH + '');
window.open(strURL,"1ARES","toolbar,status,resizable,scrollbars,top=0,left=0,width="+(screen.width*0.99)+",height="+(screen.height*0.88))


Anyone can fly, only the best Soar.
1 replies: All unread, jump to last
 
User currently offlineYOWza From Canada, joined Jul 2005, 4865 posts, RR: 15
Reply 1, posted (6 years 7 months 2 weeks 4 days 20 hours ago) and read 812 times:

SQ I'm not sure exactly what you're trying to do. If you are simply trying to get different content to show in a single IFRAME based on the selection in a drop down list you can try something like this.

To achive this you need to know the exact ID of the IFRAME for targeting reasons. YOu can use a tools like the IE developer toolbar or Firebug for Firefox to find out what the name of the frame is. Once you know this you can "get" that element from the page using the relevant object model. Something along the lines of

var targetIFRAME = document.getElementById('ThisPage_anIFRAME');
var dropDownList = document.getElementById('aDropDown');

targetFrame.src = dropDownList.GetSelectedValue() //where selected value return the required URL

this will load the content of say Yahoo.com into the frame if yahoo.com is selected from the DDL.

I would recommend using this resource, it's my JS cheatsheet: http://www.w3schools.com/js/default.asp

YOWza



12A whenever possible.
Top Of Page
Forum Index

This topic is archived and can not be replied to any more.

Printer friendly format

Similar topics:More similar topics...
Could Anyone Help Me With My New IMac? posted Fri Aug 17 2007 23:51:30 by Aero145
Help Required - Anyone Understand Polish Language? posted Fri Jun 29 2007 20:02:01 by BEWLEY747
Anyone Help Me With Shoutcast? posted Fri Dec 29 2006 18:45:28 by ThePRGuy
Anyone From France Help Me Out posted Mon Oct 9 2006 14:50:09 by J41
Would Anyone Help Your Child? posted Thu Mar 30 2006 21:02:45 by Lindy
Problem With My Printer, Can Anyone Help? posted Sat Mar 11 2006 23:23:47 by Sunshine79
Computer/Internet Problem - Can Anyone Help? posted Wed Dec 21 2005 22:09:25 by Sabena332
Web Designers: Can Anyone Help? posted Mon Nov 14 2005 23:06:27 by RobK
Anyone Help With Arabic? posted Thu Aug 11 2005 13:50:45 by Soyuzavia
Camera Price From Singapore - Anyone Help? posted Sun Oct 24 2004 06:46:35 by Davus