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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:52:47+00:00 2026-05-23T12:52:47+00:00

This sounds like a stupid question, but thought I would post anyway… I am

  • 0

This sounds like a stupid question, but thought I would post anyway…

I am just making a simple web app with javascript and html and decided upon Knockout JS for the main framework to manage the UIs. However I am a bit puzzled how to proceed.

My first page is a very simple login page, it just has a username and password box, the problem comes when I want to do thing with the UI. An example would be adding a watermark to the ui boxes, or adding logic around listening to custom events, I could just write it as in-line javascript but I cannot really unit test any of it then.

Originally I was planning to use an MVC style pattern so I could unit test the controller with a mocked view, and just put any ui logic in there.

So is there any acceptable way of doing this without putting it all as in-page logic?

  • 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-05-23T12:52:48+00:00Added an answer on May 23, 2026 at 12:52 pm

    The way mvvm works is that the view should pretty much be a visual representation of that view model, so put your logic in there. If you design it right so your functionality is contained in seperate classes then you can mock them all out easy enough. If you are used to MVC then just see the viewmodel as your controller.

    I can see where you are going with your question though, as with complex views you could end up with quite a lot happening within your ViewModel class, but if you just stick to simple oo and encapsulation principles you wont go too far wrong…

    So anyway to summarise, put it in your logic in the view model.

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

Sidebar

Related Questions

Sorry if this sounds like a really stupid question, but I need to make
Sounds like a weird question, but say I have something like this: $.post( /myajax.php,
This sounds like a stupid question (to me), but I've searched and I can't
This probably sounds like a stupid question, but I'm going to give it a
This sounds like a stupid question but, after uploading a file the file isnt
This sounds like a stupid question but i can't figure it out for the
This probably sounds like a really dumb question, but here goes....Web Services, what the
This might sound like a stupid question, but google didn't help me. Is there
This sounds like a look-up-in-the-manual question to me, but I can't find it. Suppose
I know this sounds like a really obvious question, but it's proving harder to

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.