views:

78

answers:

1

I normally don't ask for help. I have spent 3 plus hours trying to incorporate simple javascript using JQuery with MVC app. Not a production app, I am just trying to learn MVC and JQuery. I have googled and found various sample apps that I couldn't get to work. so here is a detailed explanation of the latest download that I am trying to get to work. here is the website article by well respected Dino Esposito http://msdn.microsoft.com/en-us/scriptjunkie/ff679948.aspx

just like the article mentions, I create a Asp.net MVC2 Web App(not the empty template) Than in the Site.Master I register all the css/js files in the head section and than i cut and paste the following in Site.Master

<div id="menucontainer">
        <ul id="menu">
            <li><%= Html.ActionLink("Home", "Index", "Home", 
                new { title="Home Page" }, null)%></li>
            <li><%= Html.ActionLink("About", "About", "Home", 
                new { title = "About" }, null)%></li>
            <li><%= Html.ActionLink("Misc", "Demo", "Home", 
                new { title = "Miscellaneous demos" }, null)%></li>
            <li><%= Html.ActionLink("What's up here", "Todo", "Home", 
                new { title = "Read me" }, null)%></li>
        </ul>
    </div>
</div>
    <script type="text/javascript">
        $(document).ready(function () {
            $("menucontainer").tabs();
        });
    </script>

like the article mentions. I have all my directory structure and the necessary js/css files in place. in the article he is using 1.4.1, the latest downloads are 1.8.something

can some one point to some download of Hello World JQuery With MVC? appreciate your help

+1  A: 

The current version of jQuery is 1.4.2. The fact that you state 1.8.something inclines me to believe you are in fact loading jQuery-ui; which is an add-on library for jQuery.

Can you load the page up on a browser in chrome or firefox (with firebug) and verify that jQuery is in fact working?

Also the jQuery is wrong in the article you link, the following is a more succinct way of doing what you need and uses the appropriate selector:

$(function(){
  $("#menucontainer").tabs();
})

http://www.chadmyers.com/blog/archive/2007/12/13/using-jquery-with-asp.net-mvc.aspx

this link claims to have some pretty good MVC stuff for jQuery but honestly I would encourage you to read the documentation at jquery.com and see what went wrong.

On a personal note, try to be less of a douche. I may not be John Skeet, but at least I don't throw a fit when the only person trying to help me isn't going to do all my work for me.

Gabriel
yes the article is using tabs, which comes from the UI library.
CodingJoy
I have Javascript enabled on Firefox.
CodingJoy
I know about Firebug, I just want a Hello World Example and I can't find it anywhere!
CodingJoy
Jquery is wrong!! are you saying that the code shown on this article is wrong?
CodingJoy
Yes, the correct selector is `$("#menucontainer")`. Note the `#`. That means whatever follows is the ID of a DOM element.
Ryan