SInGAPORE_AIR
Posts: 11619
Joined: Mon Nov 13, 2000 4:06 am

Javascript Help Anyone?

Mon Dec 17, 2007 6:30 pm

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.
 
User avatar
yowza
Posts: 4275
Joined: Fri Jul 29, 2005 7:01 am

RE: Javascript Help Anyone?

Mon Dec 17, 2007 9:02 pm

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

Who is online

Users browsing this forum: B52overSMF, TheF15Ace and 13 guests