|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have fumbled blindly around in every sort of doc on and off line to locate how (if possible) to assign a js variable as the value of an applet param tag generated in a "document.write" applet script.
I have found one or two syntax options but neither has helped at all. I am tapped out and I see a couple of other similiar threads around with no resolution. Here's my statement out of context. It is one of twenty such elements of an applet tag. All the others are static assignments that work fine and the applet tag is published and loads the applet fine. document.write("<PARAM NAME="links3" VALUE=" + portal">"); where 'portal' is a global var in the same page assigned to the value of document.referrer. This assignment is confirmed via a document.write on the resulting html page. I found on another forum a sample like: document.write '<param name=MAPFILE value="' + siteMapUri + '"> but that led no where no matter how I tweaked the syntax. Any insights would be salve for my wounds. I need to support NS4x & IE4.x in this implementation. Seasons Greetings! -Kim |
|
#2
|
|||
|
|||
|
For those who suffer from the same myopia as I did with my applet param question, here's the solution to my mistake as received from another forum ...
========================================= Both pieces of code do have syntax errors: correction for first is document.write("<PARAM NAME="links3" VALUE="" + portal + "">"); note doubled double-quotes around + portal + . Reason is that " denotes quotes as part of string that we want to write to document and others denotes bounds of string literals. Note that if portal is not string variable you should (but not must - behaviour may vary) use portal.toString() construct - to be sure that operator + will be understood as string concatenation operator. Second part of code seems to be VBScript. It's basic style - call to function without parentheses. But this example is incorrect too. In VBScript (as in any Basic) you can't use single quotes (') as string literal - single quote starts line comments in Basic. so you should use either code above or this one (if have trouble understanding what backslash () means. document.write('<PARAM NAME="links3" VALUE="' + portal + '">'); Michael Dubner Brainbench MVP/HTML+JavaScript http://www.brainbench.com ============================== |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > applet param as js variable |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|