I try to use Cufon fonts in my web page. I have master page and in head tag I have this:
<script src="js/jquery-1.4.2.js" type="text/javascript"></script>
<script src="js/cufon-yui.js" type="text/javascript"></script>
<script src="js/cufon-replace.js" type="text/javascript"></script>
<script src="js/GeosansLight_500.font.js" type="text/javascript"></script>
<script src="js/Impact_400.font.js" type="text/javascript"></script>
&开发者_运维百科lt;link href="App_Themes/tDefault/style.css" rel="stylesheet" type="text/css" />
and in the end of MasterPage before end body:
<script type="text/javascript"> Cufon.now();</script>
but in page i have this error: Webpage error details Message: 'Cufon' is undefined URI: http://localhost:93/en/
how can I embed this font in asp.net, is this correct way.
In your header put
<head id="Head1" runat="server">
<asp:PlaceHolder runat="server" id="phHeader">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src='<%= ResolveUrl("~/js/cufon-yui.js") %>'></script>
<script type="text/javascript" src='<%= ResolveUrl("~/js/Myriad_Pro_400.font.js") %>'></script>
<script type="text/javascript" src='<%= ResolveUrl("~/js/cufon-replace.js") %>'></script>
</asp:PlaceHolder>
</head>
Is the path to the JavaScript correct?
精彩评论