Tutorial :Jquery-Object expected



Question:

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>  


Solution:1

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>  


Solution:2

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


Solution:3

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.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »