I am trying to run the jquery with no success:
<script type="text/javascript">
$(function () {
var pathname = window.location.pathname;
var a = pathname.split('/');
if (a[1]^ = "login" || a[1] == "") {
$("#product").css("margin-left", "0px");
} elseif (a[1] == "admin.aspx") {
$(".pnlBreadcrumb").css("margin-left", "10px");
}
});
</script>
Can any one assist me , where I am getting it wrong
Thanks
^is a bitwise xor-operator.indexOfmethod, which returns the position of the found string.else ifinstead ofelseif.Note: You do not have to split the
location.pathnameproperty at/, since the path will always start with/. Simply include the slash in the code.Code:
PS. This issue is caused by a bad understanding of JavaScript. I strongly recommend to learn JavaScript before using jQuery.