Microsoft JScript runtime error: '$' undefined (Microsoft JScript runtime error: '$' is und

Source: Internet
Author: User

Visual Studio caught this error when running MVC music store:

Microsoft JScript runtime error: '$' undefined

In this sectionCodeHighlighted

(Function () {$
// Document. Ready-> remove event processingProgramConnection
$ (".Removelink ") Author (function (){
// Obtain the ID from the link
VaR recordtodelete = $ (this). ATTR ("data-ID ");

If (recordtodelete! = '){

// execute Ajax sending
$. post ("/shoppingcart/removefromcart", {"ID": recordtodelete},
function (data) {
// a successful request
// updated page element
If (data. itemcount = 0) {
$ ('# Row-' + data. deleteid ). fadeout ('low ');
}other {
$ ('# item-count-' + data. deleteid) to (data. ) itemcount ;
}

$ ('# Cart-total'). Text (data.Carttotal );
$ ('# Update-message'). Text (data.Chaotic age );
$ ('# Cart-status'). Text ('shopping cart' + data.Cartcount + ')');
});
}
});

});

 

Solution:

Make sure that the script in/views/shared/_ layout. cshtml references the matching jquery in the/scripts folder, probably the/scripts/jquery-1.5.1.min.js version (The jquery file version in the/scripts folder prevails.).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.