I am trying to print a particular area on my webpage by using jQuery printarea() function. It doesn’t work and returns an error.
and its shows error like tolowerCase is undefined
Error
return (media.toLowerCase() == “” || media.toLowerCase() == “print”)
jQuery
function printDiv() {
$('#dvTokenArea').printArea();
}
<div id="dvTokenArea" runat="server">
<asp:Label ID="lblTokenNumber" runat="server" Text="Print ME !!!!!!!!!!!!"> </asp:Label>
</div>
<asp:Button ID="btnPrintToken" runat="server" Text="Print"
OnClientClick="javascript:printDiv();" />
This is the code in the plugin which returns the error:
You haven’t given enough information to be certain but I believe that you have no
mediaattribute on yourlinkelements and you are using JQuery 1.6 or above which returnsundefinedif the attribute is not set.From the attr documentation:
So, if you have no
mediaattribute set on yourlinkelements whoserelattribute is set tostylesheet,toLowerCase()will be called on media which isundefined.