• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Passing javascript variable to SRC

 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I don't know a whole lot about javascript yet. I want to pass a javascript variable to both SRCs of a frame.
A solution I found relates to just one SRC of the frame, see below. How do I put a variable into both SRCs of the frame?
Thanks in advance
Frank
<html>
<head>
<script>
var url = "http://www.google.com"
</script>
</head>
<frameset rows="10%,*" on Load="top.mainFrame.location=top.url">
<frame src="menu.html">
<frame name="mainFrame" src="javascript:' '">
</frameset>
</html>
ps I put a space between on load to get past the javaranch security!
 
Frank Daly
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found the solution using google.
<html>
<head>
<script>
function loadFrames()
{
top.frame1.location = "http://www.google.com";
top.frame2.location = "http://www.yahoo.com";
}
</script>
</head>
<frameset rows="10%,*" on Load="top.loadFrames()">
<frame name="frame1" src="javascript:' '">
<frame name="frame2" src="javascript:' '">
</frameset>
</html>
 
I love a woman who dresses in stainless steel ... and carries tiny ads:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic