Jump to content

basic: changing variable value and updating iframe


Recommended Posts

okay i want to be able to have users click on tabs that change the content of a iframe

<script type="text/javascript">
function changevar(ports)
{
  var port = ports;
}
</script>

 

<a href="javascript:changevar(28962)">COD4</a> | <a href="javascript:changevar(28960)">COD5</a> | <a href="javascript:changevar(28961)">ZOMBIES</a></h1>
<script type="text/javascript">
// default
var port=28962;
// first part of the script
document.write("<iframe src=\"http://cache.www.gametracker.com/components/html0/?host=68.34.211.225:");
// port- this should be changed when links clicked
document.write(port);
//second part
document.write("&width=200&height=423&bgColor=000000&titleBgColor=101010&borderColor=000000&fontColor=FFFFFF&titleColor=FFFFFF&linkColor=990901&borderLinkColor=993201&showMap=1&showCurrPlayers=1&showTopPlayers=0&showBlogs=0\" frameborder=\"0\" scrolling=\"no\" width=\"200\" height=\"423\"></iframe>");</script>

 

 

this does not work.

Fixed:

var port=28962;
// first part of the script
document("<iframe src=\"http://cache.www.gametracker.com/components/html0/?host=68.34.211.225:");
// port- this should be changed when links clicked
document(port);
//second part
document("&width=200&height=423&bgColor=000000&titleBgColor=101010&borderColor=000000&fontColor=FFFFFF&titleColor=FFFFFF&linkColor=990901&borderLinkColor=993201&showMap=1&showCurrPlayers=1&showTopPlayers=0&showBlogs=0\" frameborder=\"0\" scrolling=\"no\" width=\"200\" height=\"423\"></iframe>");

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.