Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

body onload sending "" as parameter

Status
Not open for further replies.

sqoti

Programmer
Dec 1, 2000
50
US
Hello, I have a unusual circumstance that I have a variable that is surrounded by double qoutes and is passed to a javascript function. Well, when the variable is null it tries to pass the double qoutes without anything.

<body onload = &quot;myFunction(&quot;@$variable(subvariable)&quot;);>

the varibale passed is supposed be something like &quot;/docs/folder/restrict.html&quot; that is passed and used in the function. When the variable is blank it passes &quot;&quot; and errors out with object is null. I tried to take the qoutes off, but it still errors out. Any ideas?

Thanks,

Scott
 
[tt]
<body onload = &quot;myFunction('@$variable(subvariable)');&quot;>
^ ^
| |
\ /
Use Single Quotes[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top