Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8143415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:07:10+00:00 2026-06-06T13:07:10+00:00

I am porting a legacy system from rails into lift. It has a lot

  • 0

I am porting a legacy system from rails into lift. It has a lot of hard-coded concatenated javascript that I would like to render into html pages.

According to this conversation here, we can use net.liftweb.http.js.JsCmds.Script object this way:

Script("""
var x = "Here's my JavaScript & it looks good";
""")

However, I got this compiler message:

error: type mismatch;
[INFO]  found   : java.lang.String
[INFO]  required: net.liftweb.http.js.JsCmd

What is the correct way to use net.liftweb.http.js.JsCmds.Script?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T13:07:11+00:00Added an answer on June 6, 2026 at 1:07 pm

    Well, the conversation is clearly wrong.

    The apply method for net.liftweb.http.js.JsCmds.Script takes a JsCmd as a parameter – that’s the source of your compiler error.

    Now for that specific case, you could fix it to something like this:

    Script(JsCrVar("x", new Str("Here's my JavaScript & it looks good")))
    

    (Str is net.liftweb.http.js.JE.Str)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In porting an algorithm from JavaScript to Java, I've run into the problem that
I need to use legacy mode for an application that I am porting from
I have a legacy Struts 1.2.8 application that I'm maintaining and porting from Oracle
I'm porting a legacy system that uses Symfony framework. I have almost no experience
I'm porting a project from Rails to Django with a legacy database. In Rails
We're porting a legacy Java app to JRuby and would like to reuse some
I'm porting an existing app to rails that makes extensive use of stylized anchors
I am currently porting an application from iOS into Android and I have ran
I am porting a legacy Python system to Java. I'm a python developer primarily
I am porting some legacy code from windows to Linux (Ubuntu Karmic to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.