问题
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.
- Don't use inline click handlers. Consider using unobtrusive javascript.
- Don't use inline styles, use css.
- Wrap that javscript onclick handler in quotes.
- 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