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 8081825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:51:38+00:00 2026-06-05T16:51:38+00:00

I have two functions that return simple strings. Both are registered. $.views.helpers({ parseDate: function

  • 0

I have two functions that return simple strings. Both are registered.

$.views.helpers({
    parseDate: function (jsonDate) {
        if (jsonDate != null) {
            var date = new Date(parseInt(jsonDate.substr(6)));
            var newDate = $.fullCalendar.formatDate(date, "MM/dd/yyyy");
            return newDate;
        }
    },
    renderPrimaryResource: function (PrimaryResource, LessonID) {
        debugger;
        $.ajax({
            url: "cl/lb",
            dataType: "json",
            data: { id: PrimaryResource.ResourceID },
            type: 'GET',
            async: false,
            success: function (data) {
                var thumbnailImage = data[1];
                return thumbnailImage;
            }
        });
    }

});

My jsrender template calls both functions. The parse date function gets called and returns as it should. The second function gets called and returns something but jsrender doesn’t pick it up? Not sure what happens but it is completely ignored.

<script id="LessonDetailTemplate" type="text/x-jsrender">
{{for lessons}}
    <div class="row lesson-block">
        <div class="span4">
            <h4>{{:LessonName}}</h4>
            <span><strong>Due on <span>{{:~parseDate(DueDate)}}</span>
            <br/>
            <p>{{:LessonDescription}}</p>
        </div>
        <div class="span4">
            <span">{{:~renderPrimaryResource(PrimaryResource, LessonID)}}</span>
        </div>
    </div>
{{/for}}

Anyone have any ideas why this doesn’t render? The only thing I can think of is the ajax call but while debugging the template doesn’t continue until the function returns something. So I am at lost of what is going on.

  • 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-05T16:51:40+00:00Added an answer on June 5, 2026 at 4:51 pm

    Answering in case anyone stumbles upon this. The problem was in fact the ajax call. Not sure exactly what it was but you cannot return the string from the success part of the ajax call. Modified the function as follows and works fine.

    renderPrimaryResource: function (PrimaryResource, LessonID) {
        debugger;
        $.ajax({
            url: "cl/lb",
            dataType: "json",
            data: { id: PrimaryResource.ResourceID },
            type: 'GET',
            async: false,
            success: function (data) {
                var thumbnailImage = data[1];
            }
        });
        if(thumbnailImage != null){
            return thumbnailImage;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Id like to make a simple function, that return value of two Strings, basically:
I have a function that takes two delimited strings and returns the number of
Say I have two functions that expect ...rest parameters private function a(...myParams):void { trace(myParams.length);
I have a function that return an array (won't work in IE) with two
I have need for a function pointer that takes two arguments and returns a
I have two functions that have different enough logic but pretty much the same
I have two functions that are supposed to encrypt and decrypt a string but
I have created two functions that sum and subtract the numeric values of two
So I have two jquery functions that bassically do the same, but on 2
I have a php file that includes two functions, one to connect to the

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.