我有一个textarea
元素,我在其中使用 Google 输入工具,它在 localhost 中运行良好。当我在 HTTPS 域上使用相同的代码时,它不起作用。
<script type="text/javascript" src="https://suryaprakashanmandir.com/transliteration.I.js">
</script>
<script type="text/javascript">
google.load("elements", "1", {
packages: "transliteration"
});
function onLoad() {
var options = {
sourceLanguage: google.elements.transliteration.LanguageCode.ENGLISH,
destinationLanguage: [google.elements.transliteration.LanguageCode.HINDI],
shortcutKey: 'ctrl+g',
transliterationEnabled: true
};
var control =
new google.elements.transliteration.TransliterationControl(options);
control.makeTransliteratable(['transliterateTextarea']);
}
google.setOnLoadCallback(onLoad);
</script>
<textarea id="transliterateTextarea" style="width:600px;height:200px"></textarea>
代码显示:
Mixed Content: The page at 'https://suryaprakashanmandir.com/something.php' was loaded over HTTPS, but requested an insecure script 'http://www.google.com/inputtools/request?text=hello&ime=transliteration_en_hi&num=5&cp=0&cs=0&ie=utf-8&oe=utf-8&app=jsapi&uv&cb=_callbacks_._0k5me1vjh'. This request has been blocked; the content must be served over HTTPS.