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

  • Home
  • SEARCH
  • 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 8391815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:21:33+00:00 2026-06-09T19:21:33+00:00

Current I did the dustjs in client javascript as below <!DOCTYPE html> <html> <head>

  • 0

Current I did the dustjs in client javascript as below

<!DOCTYPE html>
<html>
<head>
  <script src="lib/dust-full-0.3.0.min.js" type="text/javascript"></script>
  <script src="vendor/jquery-1.7.1.min.js" type="text/javascript"></script>
  <script type="text/javascript">
  $(document).ready(function(){

  // JSON response from server 
  var json_object = { "profile_skill": "Profile Skill",
      "skills": [
            { "name": "JavaScript"  },
            { "name": "Ruby" },
            { "name": "Java" }
      ]
    }
  // render method

    dustRender = function(){
      // Get the dust html template to dust compile
      var dust_tag = $('#page').html() ; 

      var compiled = dust.compile(dust_tag, "tmp_skill");
      //load templates
      dust.loadSource(compiled);
      //Renders the named template and calls callback on completion. context may be a plain object or an instance of dust.Context.
      dust.render("tmp_skill", json_object, function(err, html_out) {
      //HTML output
         $('#page').html(html_out);
          console.log(html_out);
      });
    }();


  });

</script>

</head>
<body>
<h1>Dust templates in the browser</h1>
<div id="page">

{profile_skill}
  <ul> {#skills} 
      <li> {name} </li> 
      {/skills}
  </ul>
</div>


</body>
</html>

But in my page view source I can see the above code instead of html tag output. And also I want know how to integrate dustjs in php code.

  • 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-09T19:21:34+00:00Added an answer on June 9, 2026 at 7:21 pm

    As Torsten Walter has mentioned, you cannot see the html source in your page, if you are compiling/rendering in browser. If you do the compiling and rendering in the server side, html source will contain the final HTML code. For achieving this, you can use nodejs or Rhino server as mentioned in Linkedin blog: http://engineering.linkedin.com/frontend/leaving-jsps-dust-moving-linkedin-dustjs-client-side-templates

    This might help you to compile the dust templates using PHP,

    https://github.com/saravmajestic/myphp/tree/master/dustcompiler

    This utility is only for compiling the dust templates before rendering in the page, which will avoid compiling time in your browser. You can load the compiled templates as a JS file in your page, which can be minified/ aggregated with other JS files/templates.

    Hope this helps!!!

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

Sidebar

Related Questions

current code (not working): /^script\s*type=\text\/javascript/i.test(tagName)
Current version of Twiiter has a tab bar as shown below. When I select
I was asked this before with slight different with current question. but did not
In my current job, I have to run SQL script once in a while
I did read manuals about access to current user via everyauth. It's say, that
I did a wipe and restore. I backedup my current innodb tables. (mysqldump) I
In what OS did the use of the '.' first mean 'the current directory'
i did fastforward in music player by getting current time of the player (30
If I did this // Default implementation of UNIX time of the current UTC
Yesterday I did one of these operations (see code snippet below) on my git

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.