What am I doing wrong?

I'm trying to implement tabs using the jquery-tabs.js (the JqueryTabs
Plugin), but when I run the application, I get the following
javascript error:

   jQuery.Tabs is undefined  http://localhost:8080/ Line 34

I'm using the following snippet to create the jquery script
initializing the tabs.

class HomePage {
def tabRender(selector: String, height: String, width: String, tabs:
List[String], ids: List[String]) : NodeSeq = {

    val onLoad = Unparsed("""
                 $(document).ready(function() {
                    jQuery.Tabs.initialize('"""+selector+"""', '"""+height
+"""', '"""+width+"""',
                       """ + JsArray(tabs.map(Str(_)):_*) + """, """ + JsArray
(ids.map(Str(_)):_*) + """ );

       <script type="text/javascript" src={"/" +
LiftRules.resourceServerPath + "/jquery-tabs.js"}></script>
       <script type="text/javascript" src={"/" +
LiftRules.resourceServerPath + "/jquery-ui-1.7.1.custom.min.js"}></
       <script type="text/javascript" charset="utf-8">{onLoad}</

  def renderTabs(xhtml: NodeSeq): NodeSeq = {
     val ids = List("Page1", "Page2", "Page3")
     val tabs = List("Tab1","Tab2", "Tab3")

      tabRender("MyTabbedView","300px", "150px", tabs, ids )

My index.html is the following:

<lift:surround with="default" at="content">
   <div id = "MyTabbedView"></div>
   <div id = "Page1">Page 1<br/>Description of jQuery Tabs plugin</
   <div id = "Page2">Page 2<br/>How to use this plugin</div>
   <div id = "Page3">Page 3<br/>Download plugin</div>

I put the jquery-tabs.js file in src/main/resources/toserve.

The returned source at http://localhost:8080 contains the following

<script type="text/javascript" src="/classpath/jquery-tabs.js">
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
<html><body>The Requested URL /classpath/jquery-tabs.js was not found
on this server</body></html>

Any help on getting this to run would be appreciated.

Glenn Silverman

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to