tags:

views:

644

answers:

3

Can somebody tell me why Jquery is erroring out at this point?

  <script type="text/javascript" language="javascript">
        var myLayout; 
       // a var is required because this page utilizes: 
       // myLayout.allowOverflow() method
        $(document).ready(function() {
            myLayout = $('body').layout({
            // enable showOverflow on west-pane 
            // so popups will overlap north pane
            // west__showOverflowOnHover: true
           });
       });
  </script>
+1  A: 

Unless you have your own custom plug-in extension. $('body').layout() is not a valid jQuery function.

EDIT: I'm assuming that you are using this plug-in. Make sure the inclusion of the <script> tag for the plug-in comes after the inclusion of jQuery and not the other way around. This is most likely the source of the error.

Example:

<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jquery.layout.min.js"></script>
ichiban
I was going to say, you haven't included the plugin script perhaps, or that script is declared above your jquery core script?
steve_c
A: 

My guess would be because layout is not a function of body or of the jQuery object...however it doesn't particularly help unless you actually give us an error.

Thomas
C# directive left out intentionallyThe JavaScript error is the following;A Runtime Error has occured. Do you wish to Debug?Line: 72Error: 'myLayout' is null or not an object
Berlioz
A: 

Just figured out the problem.

I overlooked the placement of my site.

I placed it in c:\Projects\MySites\JohnsonCo.sln

Notice that is not in the wwwroot directory! That is, *c:\Inetpub\wwwroot*

I'm guessing IIS was not configured correctly and that's why no sort of directory specification was working in the script src attribute().

I thought I would never answer my own question but I think I just did. Thanks for the input, for those of you who responded!

Thanks, Berlioz

Berlioz