Gujarati Language not showing

不羁的心 提交于 2019-12-06 11:37:13

问题


i create blogger blog For Gujarati Language Quiz I used JS for a button in my blog at http://quizgujarat.blogspot.in i use javascript in blogspot (blogger) post when i click not radio button Gujarati Language Not showing in Alert Msg please help

I use This Script Code

<input  type="button" style="margin-left: 0px"  style="border:none" style="color:#999999" style="background-color: #fff0e0" value=" ક્લિક કરો " onclick=javascript:msg1001() /><script language="JavaScript">function msg1001(){alert("(A) વિકલ્પ Assam");}</script></td></tr><td valign="top" width="5%"><br />

回答1:


Well, it works in the Fiddle that I just created. Although it works, that doesn't mean that you should use it.

A few recommendations, outside the scope of the question.

  1. Don't use inline click handlers. Consider using unobtrusive javascript.
  2. Don't use inline styles, use css.
  3. Wrap that javscript onclick handler in quotes.
  4. Move that script tag to the header of the page. Because the script tag is below the calling code, you could have a partially rendered page and "msg1001" may not exist yet when the button is clicked.



回答2:


To display Gujarati font on any website there is only one requirement

<head>
     <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'/>
</head>

And the page should be stored in utf-8 encoding.

Note: Once you have specified this meta tag then you need to remove other specifications for example if you are using jsp page then

 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

this declarative should be removed or should be correct. Check you html page where this ambiguity can stop Gujarati font from displaying.



来源:https://stackoverflow.com/questions/14504304/gujarati-language-not-showing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!