(function($) {
$(document).ready(function() {
$("#subscribe").click(function()
{
var email=$("#subscribeid").val();
var atpos=email.indexOf("@");
var dotpos=email.lastIndexOf(".");
if (atpos<1 || dotpos=email.length)
{
$("#subscribeid").css("border", "2px solid #FF0000");
return false;
}
var dataString = 'email='+ email;
$.ajax
({
type: "GET",
url: "subscribe.php",
data: dataString,
cache: false,
success: function(html)
{
if(html=="Subscribed Successfully"){
var url = "https://srividhyasridhar.com/wp-content/uploads/2020/12/blank-diet-plan.pdf";
window.open(url, '_blank');
}
$("#subscribeid").val("");
$("#result").show("");
$("#result").html(html);
return false;
}
});
});
});
})(jQuery);