473,385 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Function in Param Tag?

Actionscriptor needs help!

I have a working javascript function (getVar()) that extracts a variable
from a link and returns it. (tested with alert() works fine). But I am
unsure of how to right the following line.

document.write("<param name='flashVars' value=&{getVar(text)}>)

This is a param from an object tag (embedding flash) and i'm trying to
dynamically set the flashVars param, but this 1 line is killing me.

How do i properly right this line?

Many Thanks in advance..

Jul 23 '05 #1
5 1988
Keeko wrote:
Actionscriptor needs help!

I have a working javascript function (getVar()) that extracts a variable from a link and returns it. (tested with alert() works fine). But I am unsure of how to right the following line.

document.write("<param name='flashVars' value=&{getVar(text)}>)

This is a param from an object tag (embedding flash) and i'm trying to dynamically set the flashVars param, but this 1 line is killing me.

How do i properly right this line?

Many Thanks in advance..


document.write('<param name="flashVars" value="' + getVar(text) +
'">');

Jul 23 '05 #2
Thanks Rob. It's still not working however. I'll assume based on your
example, that I can't have the function defined withing the quotes of the
write("") statement. but still not working.

Question. Do i need to have the document.write(... withing a <script> tag???
i've tried both but it doesn't work either way. Here's some of the page.
---------------------
<script language="javascript">
var locate = window.location // Get the link string
document.hiddenForm.hiddenInput.value = locate // put the link string into a
hidden form.
var text = document.hiddenForm.hiddenInput.value

function getVar(str){
theVar = str.indexOf("=") + 1;
return("myVar="+str.substring(theVar));
}

</script>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
width="500" height="500">
<param name="movie" value="varTest.swf">
document.write('<param name="flashVars" value="'+getVar(text)+'">');
<param name='menu' value='false'>"
<param name="quality" value="high">

</object>
<script language="javascript">alert(getVar(text)); //Tests fine </script>
</body>
</html>
---------------------

Thanks for the help!

"RobB" <fe******@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Keeko wrote:
Actionscriptor needs help!

I have a working javascript function (getVar()) that extracts a

variable
from a link and returns it. (tested with alert() works fine). But I

am
unsure of how to right the following line.

document.write("<param name='flashVars' value=&{getVar(text)}>)

This is a param from an object tag (embedding flash) and i'm trying

to
dynamically set the flashVars param, but this 1 line is killing me.

How do i properly right this line?

Many Thanks in advance..


document.write('<param name="flashVars" value="' + getVar(text) +
'">');

Jul 23 '05 #3
I've also stumbled across this approach but again it seems to fail. any
Suggs???

<param name="flashVars" value=&{getVar(text)};>
Again, testing getVar(text) using alert(getVar(text)) returns correctly...

Cheers!

"RobB" <fe******@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Keeko wrote:
Actionscriptor needs help!

I have a working javascript function (getVar()) that extracts a

variable
from a link and returns it. (tested with alert() works fine). But I

am
unsure of how to right the following line.

document.write("<param name='flashVars' value=&{getVar(text)}>)

This is a param from an object tag (embedding flash) and i'm trying

to
dynamically set the flashVars param, but this 1 line is killing me.

How do i properly right this line?

Many Thanks in advance..


document.write('<param name="flashVars" value="' + getVar(text) +
'">');

Jul 23 '05 #4
Keeko wrote:
I've also stumbled across this approach but again it seems to fail. any Suggs???

<param name="flashVars" value=&{getVar(text)};>
Again, testing getVar(text) using alert(getVar(text)) returns correctly...
Cheers!

"RobB" <fe******@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Keeko wrote:
Actionscriptor needs help!

I have a working javascript function (getVar()) that extracts a

variable
from a link and returns it. (tested with alert() works fine). But I
am
unsure of how to right the following line.

document.write("<param name='flashVars' value=&{getVar(text)}>)

This is a param from an object tag (embedding flash) and i'm
trying to
dynamically set the flashVars param, but this 1 line is killing

me.
How do i properly right this line?

Many Thanks in advance..


document.write('<param name="flashVars" value="' + getVar(text) +
'">');


This -

&{getVar(text)};

....is a JavaScript entity, a Netscape invention that allows
interpolation of JS code directly into HTML, without a <script> block
and document.write. Not sure if later (mozilla) version support it, but
afaik other browsers don't, and it's rarely seen. If the above function
tests out correctly, try outputting the entire <object> dynamically.

<script type="text/javascript">

document.write(

'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' ,
'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#v..."
' ,
'width="500" height="500">' ,
'<param name="movie" value="varTest.swf">' ,
'<param name="flashVars" value="' + getVar(text) + '">' ,
'<param name="menu" value="false">' ,
'<param name="quality" value="high">' ,
'</object>'

);

</script>

Note that document.write takes multiple arguments, comma-separated as
usual. And, yes - it needs to be within a <script> block (hey, it's
script!).

Jul 23 '05 #5
Enitre Object dynaically worked perfectly... Thanks!

"RobB" <fe******@hotmail.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
Keeko wrote:
I've also stumbled across this approach but again it seems to fail.

any
Suggs???

<param name="flashVars" value=&{getVar(text)};>
Again, testing getVar(text) using alert(getVar(text)) returns

correctly...

Cheers!

"RobB" <fe******@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
> Keeko wrote:
>> Actionscriptor needs help!
>>
>> I have a working javascript function (getVar()) that extracts a
> variable
>> from a link and returns it. (tested with alert() works fine). But I > am
>> unsure of how to right the following line.
>>
>> document.write("<param name='flashVars' value=&{getVar(text)}>)
>>
>> This is a param from an object tag (embedding flash) and i'm trying > to
>> dynamically set the flashVars param, but this 1 line is killing me. >>
>> How do i properly right this line?
>>
>> Many Thanks in advance..
>
> document.write('<param name="flashVars" value="' + getVar(text) +
> '">');
>


This -

&{getVar(text)};

...is a JavaScript entity, a Netscape invention that allows
interpolation of JS code directly into HTML, without a <script> block
and document.write. Not sure if later (mozilla) version support it, but
afaik other browsers don't, and it's rarely seen. If the above function
tests out correctly, try outputting the entire <object> dynamically.

<script type="text/javascript">

document.write(

'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' ,
'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#v..."
' ,
'width="500" height="500">' ,
'<param name="movie" value="varTest.swf">' ,
'<param name="flashVars" value="' + getVar(text) + '">' ,
'<param name="menu" value="false">' ,
'<param name="quality" value="high">' ,
'</object>'

);

</script>

Note that document.write takes multiple arguments, comma-separated as
usual. And, yes - it needs to be within a <script> block (hey, it's
script!).

Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Albert | last post by:
Hi, I need to pass a pointer-to-member-function as a parameter to a function which takes pointer-to-function as an argument. Is there any way to do it besides overloading the function? Here...
3
by: Chris | last post by:
function Main(param) { alert("test "+param); <<<<<<<<<<< Ici tout se passe bien : le contenu de param est bien affiché fchaine='' .... +'<div ><a href="#" onclick="javascript:return...
7
by: Chris | last post by:
<< Translation in english of my main post >> Hi, I do not success to pass by parameter the contents of "param". in the function "Main" if I replace Suite('+param+') by Suite('+40+') dans la...
2
by: laredotornado | last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to have my Javascript function execute from the BODY's "onload" method, but if there is already an onload method defined, I would...
23
by: bluejack | last post by:
Ahoy... before I go off scouring particular platforms for specialized answers, I thought I would see if there is a portable C answer to this question: I want a function pointer that, when...
4
by: _Mario.lat | last post by:
Hallo, I have a little question: In the function session_set_save_handler I can pass the name of function which deal with session. In Xoops code I see the use of this function like that: ...
0
by: bog39 | last post by:
We have z/os and DB/2 V. 8 running. I try to create a new UDF using the command CREATE FUNCTION: CREATE FUNCTION CNGETADR (INTEGER) RETURNS CHAR(50) EXTERNAL NAME CNADR001 ...
3
by: David | last post by:
Hi, This is causing me a few problems as I am not sure how to handle this... I have a data access layer. My layer is built in such a way that I can use any database type I choose, such as SQL...
1
by: coppersaucepipe | last post by:
<xsl:call-template name="Blanks"> <xsl:with-param name="NumPop" select="$NoOfBloggs"/> <xsl:with-param name="Required" select="10"/> <xsl:with-param name="FileName" select="'fred.xml'"/>...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.