1

I have implemented the .NET Login functionality, and I am receiving a JavaScript Error whenever a User clicks on the Log-In Anchor Button to reach the Login.aspx.

This Anchor Menu Button is part of the CSS Menu which is defined within the Master Page.

When I run this locally, the error indicates:

'ddmegamenu' is undefined

However this script is defined within the MasterPage:

All of the sub-pages can see this script including the Login.aspx:

<script type="text/javascript">
    ddmegamenu.docinit({
        menuid: 'solidmenu',
        dur: 200 //<--no comma after last setting
    })
</script>

Here is the development site: http://www.virtualpetstore.com

The Login.aspx is within a seperate Account Directory, but I don't think this should be a problem.

If anyone can see this issue, I would really appreciate it.

2 Answers 2

3

You're getting the error because you're not properly referencing the JS files on the Login.aspx page. This is what the console says (in addition to the error that you posted):

GET http://www.virtualpetstore.com/Account/js/jquery.js 404 (Not Found)
GET http://www.virtualpetstore.com/Account/js/jquery-1.5.min.js 404 (Not Found)
GET http://www.virtualpetstore.com/Account/js/jquery-ui.min.js 404 (Not Found)
GET http://www.virtualpetstore.com/Account/js/jquery.serialScroll-min.js 404 (Not Found)
GET http://www.virtualpetstore.com/Account/js/ddmegamenu.js 404 (Not Found)
GET http://www.virtualpetstore.com/Account/js/jquery.scrollTo-min.js 404 (Not Found)
GET http://www.virtualpetstore.com/Account/js/jquery.simplemodal.js 404 (Not Found)
GET http://www.virtualpetstore.com/Account/js/jquery.cycle.min.js 404 (Not Found)
GET http://www.virtualpetstore.com/Account/js/jquery.actual.js 404 (Not Found)
GET http://www.virtualpetstore.com/Account/js/contact.js 404 (Not Found)

Ensure that your JS files are being loaded and your error will most likely disappear.

Hint: Your script tags should look something like this:

<script type="text/javascript" src="/js/ddmegamenu.js"></script>
Sign up to request clarification or add additional context in comments.

4 Comments

And while doing that, don't include jQuery twice.
@James Hill I changed all of the script tags with: src="/js/ddmegamenu.js Now I don't receive the fatal error as before indicating 'ddmegamenu' is undefined however at the bottom of all of every page it indicates: "done but with errors on the page" you can see this on the dev site: virtualpetstore.com
@Paul, I just checked out the site and I'm not seeing any errors. Did my solution work for you?
@JamesHill yes your solution did work. At the bottom of the page in the status bar, it indicates "done but with errors"
0

The problem is simple, on Account/Login.aspx you try to include Account/js/ddmegamenu.js but you need on this url /js/ddmegamenu.js

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.