_Layout javascript
<script src="~/Scripts/bootstrap.min.js"></script>
<script type="text/javascript">
function searchByTitle() {
var txtval = document.getElementById("txtSearch").value;
var url = '@Url.Content("~/Comics/ComicsByTitle?inTitle=")' + txtval;
window.location.href = url;
}
function logInn() {
var txtval = document.getElementById("txtEmail").value + ";pWord=" + document.getElementById("txtPword").value;
var url = '@Url.Content("~/Home/LogInn?inString=")' + txtval;
window.location.href = url;
}
function ajaxLogInn() {
var instring = document.getElementById("txtEmail").value + ";pWord=" + document.getElementById("txtPword").value;
$.ajax({
url: 'Home/LogInn',
data: { inString: instring },
success: function (data) {
if (data == 'True') {
document.getElementById("lblErrMsg").innerHTML = "Howdy " + document.getElementById("txtEmail").value
}
else {
document.getElementById("lblErrMsg").innerHTML = "Invalid Login credentials";
}
},
error: function (e) {
alert('Error occured ' + e);
}
});
}
function logEmIn(inString) {
alert("297 logEmIn= " + inString);
}
</script>
<script>
$(document).ready(function () {
$('.dropdown a.test').on("click", function (e) {
$(this).next('ul').toggle();
e.stopPropagation();
e.preventDefault();
});
});
</script>
<script>
$(function () {
$(".dropdown-menu > li > a.trigger").on("click", function (e) {
var current = $(this).next();
var grandparent = $(this).parent().parent();
if ($(this).hasClass('left-caret') || $(this).hasClass('right-caret'))
$(this).toggleClass('right-caret left-caret');
grandparent.find('.left-caret').not(this).toggleClass('right-caret left-caret');
grandparent.find(".sub-menu:visible").not(current).hide();
current.toggle();
e.stopPropagation();
});
$(".dropdown-menu > li > a:not(.trigger)").on("click", function () {
var root = $(this).closest('.dropdown');
root.find('.left-caret').toggleClass('right-caret left-caret');
root.find('.sub-menu:visible').hide();
});
});
</script>