I’m struggling with the following code. The first if statement is doing what I want, then I need to make sure I don’t add a parameter to an href if it ends in .pdf … the second if statement is not working. I’m sure it is something simple because I know very little! Please help. Thanks!
var string2 = "x";
if (document.domain.indexOf(string2)!== -1) {
}
else {
$("#breadcrumb a").each(function(){
this.search = 'lnkid=bc';
});
if ($("#linklist a[href$='.pdf']") > -1 ) {
}
else {
$("#linklist a").each(function(){
this.search = 'lnkid=snav';
});
}
Why not just: