heero11yuy Posted August 23, 2006 Share Posted August 23, 2006 How to Send a var to a PARAM value?Say I have a variable of X...<HTML><HEAD><TITLE>StoryMan Personal Word List</TITLE></HEAD><script type=text/javascript>var X = 999</script><body><table><tr><td><object><param name=abc value="filename.swf?id= X " ><!-- here, I want to set id = var X... does anyone know how to do it? --></OBJECT></TD></TR></TABLE></body></HTML> Link to comment Share on other sites More sharing options...
Reg Edit Posted August 23, 2006 Share Posted August 23, 2006 If you want to include a variable value in the HTML, you can use document.write() to output that HTML instead. So I would think your param can be set as follows: <script language="javascript"> document.write('<param name="abc" value="filename.swf?id=' + X + '">');</script> Link to comment Share on other sites More sharing options...
Chocolate570 Posted August 24, 2006 Share Posted August 24, 2006 Or you could put this right before the </body> tag: <script type="text/javascript">document.getElementsByName("abc").value="filename.swf?id="+x;</script> That should work too Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now