Note that there are some explanatory texts on larger screens.

plurals
  1. POCombining jQuery UI and HotTowel
    primarykey
    data
    text
    <p>I'm getting back into web development a bit after having been kind of out of it for the past 10 years or so, and I'm overwhelmed by all the new technologies that I'm having to catch up with, ASP.NET, MVC, jQuery, SPA, Knockout, etc. I don't know the second thing about jQuery and my experience with ASP.NET is very limited. I have a little familiarity with ASP.NET WebForms, but MVC (and the rest) is totally new to me.</p> <p>After seeing how many technologies there were, and not knowing which route to explore in my new project, I saw that Hot Towel seems to be a template that combines all the latest stuff into one nice package, so I decided to get the Hot Towel template and start an ASP.NET MVC4 SPA project with it.</p> <p>Now I'm trying to integrate with our in-house UI framework (which has been developing without me over the past few years). I decided to try to update the Details page in the Hot Towel template to have some content. I added a simple <code>&lt;span&gt;</code>, and all's well and good. But if I try to add what I understand to be a jQuery-widget-based component (?), I get nothing. Even for the simplest test of adding content via jQuery, I get nothing:</p> <pre><code>&lt;section&gt; &lt;h2 class="page-title" data-bind="text: title"&gt;&lt;/h2&gt; &lt;span&gt;Test this&lt;/span&gt; &lt;div id="testDiv"&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; $("#testDiv").append("Testing"); &lt;/script&gt; &lt;/section&gt; </code></pre> <p>I see the <code>span</code>, but not the modified <code>div</code>. And I can't see any of this content in the source ("View source") or the IE9 console (not surprising given the nature of SPA, but what should I do about it?). And the Visual Studio Page Inspector seems to be totally useless (can't get past the splash screen).</p> <p>What is the proper method of adding elements to the UI under the HotTowel/jQuery/MVC/SPA/KockoutJS/Breeze/Durandal model? All these new frameworks are driving my crazy.</p> <p><strong>Edit</strong> some more details: The jQuery stuff works fine when I move it to the main page of the SPA, but when I have it on the Details "page" it doesn't work. I suspect it has something to do with the SPA nature of this application and how the content of alternate views are delivered not as an entire page, but as updated content for the main page.</p> <p><strong>Edit</strong> after further investigation, I have discovered the existence of a view model named "detail" which is probably related to this detail view code I have posted. This is the code from the view model:</p> <pre><code>define(['services/logger'], function (logger) { var title = 'Details'; var vm = { activate: activate, title: title }; return vm; //#region Internal Methods function activate() { logger.log(title + ' View Activated', null, title, true); return true; } //#endregion }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload