Closed Thread Icon

Preserved Topic: Capture SSI variable in javascript variable Pages that link to <a href="https://ozoneasylum.com/backlink?for=20906" title="Pages that link to Preserved Topic: Capture SSI variable in javascript variable" rel="nofollow" >Preserved Topic: Capture SSI variable in javascript variable\

 
Author Thread
Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 05-11-2001 16:18

Greets -

I need to capture an SSI variable, $QUERY_STRING_UNESCAPED into a javascript variable. I tried
var template=<!--#echo var="$QUERY_STRING_UNESCAPED" -->
but that left the variable as undefined.

What's the best way to do this?

Pat Richard
A pixel is worth a thousand words.
http://www.gurusnetwork.com
ICQ 23113317

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 05-11-2001 17:22

I believe the problem would then rest in the query string. If there is no query string returned then it would return undefined. But it should give output.

var j = '<!--#echo var="$QUERY_STRING_UNESCAPED" -->';

Ah, writing that I think I found the problem.

If you do not put, the SSI call into quotes of some sort, the JS engine will believe that what is returned is a variable, because it is just a word. And then the variable would not reference any data, therefore you get undefined.

maybe?

linear
Paranoid (IV) Inmate

From: other places
Insane since: Mar 2001

posted posted 05-11-2001 17:23

Lose the $ and it works for me.

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 05-11-2001 22:33

oh yeah, i missed that one completely...

« BackwardsOnwards »

Show Forum Drop Down Menu