Note that there are some explanatory texts on larger screens.

plurals
  1. POUncaught reference error lift ajax is not defined
    primarykey
    data
    text
    <p>I'm trying to create a Lift chat server. I've taken everything straight from the Lift book that is linked to from Lift's main website. Upon running it, I cannot submit my messages because liftAjax is undefined and causes an error that appears in my chrome console.</p> <p>Correct me if I'm wrong, but shouldn't Lift generate the liftAjax stuff upon starting up the website? I have a feeling I could import liftAjax myself from some source and it would work, but I don't feel I should have to do this.</p> <p>This is my index.html file.</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt;&lt;title&gt;Home&lt;/title&gt;&lt;/head&gt; &lt;body class="lift:content_id=main"&gt; &lt;div id="main" class="lift:surround?with=default;at=content"&gt; &lt;!-- the behavior of the div --&gt; &lt;div class="lift:comet?type=Chat"&gt;Some chat messages &lt;ul&gt; &lt;li&gt;A message&lt;/li&gt; &lt;li class="clearable"&gt;Another message&lt;/li&gt; &lt;li class="clearable"&gt;A third message&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div&gt; &lt;form class="lift:form.ajax"&gt; &lt;input class="lift:ChatIn" id="chat_in" /&gt; &lt;input type="submit" value="Say Something" /&gt; &lt;/form&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>This is what is generated:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;div id="main" xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;!-- the behavior of the div --&gt; &lt;div id="F156429460218VSI1GX_outer" style="display: inline"&gt; &lt;div id="F156429460218VSI1GX" style="display: inline"&gt; &lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;Some chat messages &lt;ul&gt; &lt;li&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt;&lt;script type="text/javascript"&gt; // &lt;![CDATA[ /* JSON Func comet $$ F156429460221QEXVXK */function F156429460221QEXVXK(obj) {liftAjax.lift_ajaxHandler('F156429460221QEXVXK='+ encodeURIComponent(JSON.stringify(obj)), null,null);} // ]]&gt; &lt;/script&gt;&lt;/div&gt;&lt;script type="text/javascript"&gt; // &lt;![CDATA[ var destroy_F156429460218VSI1GX = function() {} // ]]&gt; &lt;/script&gt;&lt;/div&gt; &lt;div&gt; &lt;form id="F156429460223BHVYIM" action="javascript://" onsubmit="liftAjax.lift_ajaxHandler(jQuery('#'+&amp;quot;F156429460223BHVYIM&amp;quot;).serialize(), null, null, &amp;quot;javascript&amp;quot;);return false;"&gt; </code></pre> <p>Note: the error happens on the above line</p> <pre><code>&lt;input name="F1564294602245ECYAU" id="chat_in" xmlns="http://www.w3.org/1999/xhtml" /&gt; &lt;input value="Say Something" type="submit" xmlns="http://www.w3.org/1999/xhtml" /&gt; &lt;/form&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I'm just not really sure what could be causing this. I'm just starting to learn Lift so I do not know much. Am I missing something?</p> <p>If you need more information, such as build.sbt or other files just let me know and I can post them as well.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload