[alicebot-general] Setting predicates to value of a variable
Alan Haymes
a.haymes at nicobloc.com
Fri Apr 28 08:54:32 PDT 2006
I should have said that I was using Pandorbots and my javascript is within an
aiml category therefore presumably client side.
My code is below (the line giving me the problem is in bold):
<category><pattern>HI</pattern>
<template>
<script language="JavaScript">
function get_cookie ( cookie_name )
{
var results = document.cookie.match ( cookie_name + '=(.*?)(;|$)' );
if ( results )
return ( unescape ( results[1] ) );
else
return null;
}
if ( ! get_cookie ( "visitor" ) )
{
document.write("<set name="topic">Hi. What is your name</set>");
}
else
{
var visitor = get_cookie ( "visitor" );
document.write ( "Hi " + visitor + ", welcome back to my website!" );
}
</script>
<set name="name"><javascript>visitor</javascript></set>
</template>
</category>
--
View this message in context: http://www.nabble.com/Setting-predicates-to-value-of-a-variable-t1523359.html#a4142994
Sent from the Alicebot General forum at Nabble.com.
More information about the alicebot-general
mailing list