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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:38:17+00:00 2026-06-17T20:38:17+00:00

I have a main page where i have all the scripts referred and inside

  • 0

I have a main page where i have all the scripts referred and inside the body i have a duv container which has template data binding and my htm’s are getting binded in there.

The problem is my functionality which is controlled by Jquery is not working properly.
For e.g. A date picker works when i put it in the main page where JavaScript are referred but doesn’t work inside my htm’s which are getting binded to the template.

All the libraries are getting loaded properly but my jquery functionality doesn’t work when its getting called inside the template.

e.g.
Main Page:

<script src="Scripts/jquery.js" type="text/javascript"></script>
<script src="Scripts/jquery.qtip.js"></script>
<script src="Scripts/foundation.min.js"></script>
<script src="Scripts/jquery.tablesorter.js"></script>
<script src="Scripts/jquery-ui.js"></script>
<script src="Scripts/languageswitcher.js"></script>

<div id="Container" ua-app-id="topVm" data-bind='template: {name: pageModel, data: pageVM }'>                   
</div>
<!-- Initialize JS Plugins -->
<script src="Scripts/app.js"></script>

Now my view get loaded in the main page at run time. Inside my view i have a date picker, it doesn’t work. When i put that out in the main page it works fine.

  • 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-17T20:38:18+00:00Added an answer on June 17, 2026 at 8:38 pm

    I think this is because your jQuery code is run before your template is rendered. You can use the afterRender callback provided in the template binding to enable enable the datepicker. Look at the documentation for more information and examples.

    But an even better method to accomplish this, is to create a custom binding. Something like this:

    ko.bindingHandlers.datepicker = {
        init: function(element){
            $(element).datepicker();
        },
        update: function(element) {
            $(element).datepicker('refresh');
        }
    };
    

    Then you can make text-input into a datepicker by doing this:

    <input type="text" data-bind="datepicker:true" />
    

    Read more about custom bindings here

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

Sidebar

Related Questions

I have a index.php page that is the main page. All pages are included
I have a page (main.php) which loads content from an external PHP file (rpc.php).
On my main page I have this jquery code which does an ajax call
I have an PHP/HTML main page, in which I include different other PHP files
I have a grid view in my main page and I display some data
Say, for instance, you have a popup which opens from your main page. The
I am working with MVC v4. I have a '_BootstrapLayout' page which defines all
I have a main page from where I am making a call to load
I am using jQuery for a simple website and have a main page 'index.html'
I have in the main page with two principal parts : in the left

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.