View Complete Thread | FoxWeb Forum Home
Search:
Date:    Msg ID:   
From:    Thread:   
Subject:   
Oops, sorry for the misinformation.  You actually need to enclose the string in quotes, like so:
 
alert('<%=data%>')
 
Another problem is that the value returned by data may also contain quotes, which would confuse the browser.  To get around this problem you must escape special characters, using the Server.JSEscape method:
 
alert('<%=Server.JSEscape(data)%>')

FoxWeb Support Team
support@foxweb.com email

Sent by Richard on 03/19/2004 11:12:10 PM:
Thanks for your quick response that worked but I found a little problem if I am passing a value like "this is a test" I get a error it appears to be because of spaces in the text if  it is continuious text it's ok I tried using alltrim but this made no difference. Thanks for your help
Sent by FoxWeb Support on 03/19/2004 10:10:39 PM:
If you want to evaluate the expression data and display it in a JavaScript alert box, then you need to use the following syntax:
 
alert(<%=data%>)

FoxWeb Support Team
support@foxweb.com email

Sent by Richard on 03/19/2004 03:05:11 PM:
I am having trouble passing a database values to a function so I am using the alert as a example of the code  what is the problem with alert(<%data%>) I get a error saying  unrecognized command verb. The database is open  what am I forgetting? Thanks