...

View Full Version : sending a variable?



cursor_joe
03-19-2005, 04:05 AM
is there a way to send a variable containing words to an included file which holds a function?

this is my call statement...



if(selobj.options[idx].id!="")
{
var stat=selobj.options[idx].id;
scroll(stat);
}
}
//-->
</SCRIPT>
<script type='text/javascript' src='status_2.js'></script>
</HEAD>


and this is 'status_2.js'


// JavaScript Document
<!-- hide
var count = 0;
function scroll (stat) {
window.status=stat.substring (count, stat.length)+stat.substring
(0,count)
if (count<text.length)
count ++;
else
count=0;
setTimeout ("scroll(stat)", 75);
}
//-->


is there a way to send that variable, or will i just have to transfer it all to the one file?

vwphillips
03-19-2005, 08:35 AM
your code =




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>
<title></title>
<script language="JavaScript" type="text/javascript">
<!--
if(selobj.options[idx].id!="")
{
var stat=selobj.options[idx].id;
scroll(stat);
}
}
//-->
</script>
<script language="JavaScript" type="text/javascript">
<!--
var count = 0;
function scroll (stat) {
window.status=stat.substring (count, stat.length)+stat.substring
(0,count)
if (count<text.length)
count ++;
else
count=0;
setTimeout ("scroll(stat)", 75);
}
//-->
</script>
</head>

<body>

</body>

</html>


ie the external js is inserted in the page as the page is rendered



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum