我怎样才能使用JavaScript大写我的域名的字母? [英] How can I capitalize the letters of my domain name using javascript?

查看:71
本文介绍了我怎样才能使用JavaScript大写我的域名的字母?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我的域名是www.hello.com



如何使用jQuery / JavaScript使浏览器的URL栏看起来像www.HELLO.com ?

解决方案

您无法更改在浏览器的网址栏中显示的内容。这是一个基本的安全功能。



您可以将您的域名全部大写(并将页面重定向到该版本)。不起作用,请参阅@克里斯蒂安的评论:大多数浏览器不关心大小写,因此重定向到HELLO.com仍然会显示为hello.com)

您也可以在浏览器窗口的标题栏(HTML文档标题)中显示HELLO.com。


Suppose my domain name is www.hello.com

How can I use jQuery/JavaScript to make the browser's URL bar look like "www.HELLO.com"?

解决方案

You cannot change what gets displayed in the browser's URL bar. That is a basic security feature.

You could make your domain all upper case (and redirect the pages to that version). (That apparently does not work, see @Kristian's comment: Most browsers are not concerned about case, hence a redirect to HELLO.com would still appear as hello.com)

You could also display HELLO.com in the browser window's title bar (the HTML document title).

这篇关于我怎样才能使用JavaScript大写我的域名的字母?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆