This week's book giveaway is in the Spring forum.
We're giving away four copies of Modern frontends with htmx and have Wim Deblauwe on-line!
See this thread for details.
Win a copy of Modern frontends with htmx this week in the Spring forum!
  • 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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>
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic