Date:  06/01/2004 04:42:55 PM Msg ID:  002087
From:  FoxWeb Support Thread:  002085
Subject:  Re: Converting JS string to var
You can do this:
 
var jsnote='<%=(m.notes)%>'
writeText('notes', jsnote, 400, 200, true, false);

...or this:

writeText('notes', '<%=(m.notes)%>', 400, 200, true, false);

 

FoxWeb Support Team
support@foxweb.com email

Sent by Joe Goldsmith on 05/31/2004 11:09:20 AM:
I have the following javascript that only uses a hard string in the second position:
 
writeText('notes', 'Some Text', 400, 200, true, false);
 
What I need to do is to place a foxpro variable in the second position such as:
 
var jsnote=<%=(m.notes)%>
writeText('notes', jsnote, 400, 200, true, false);
 
I have used, to no avail:
writeText('notes', jsnote, 400, 200, true, false);
writeText('notes', 'jsnote', 400, 200, true, false);
writeText('notes', <%=EVAL(=(m.notes)%>, 400, 200, true, false);
 
And most everything else I can think of. The only thing That works is
writeText('notes', 'Some Text', 400, 200, true, false);
 
How do I put a foxpro variable in a JS call in the second position so that it is properly passed to a JS function please?
 
Joe