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.

Link to comment
Share on other sites

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>");

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.