javascript alert乱码的解决方法_javascript技巧

WBOY
Release: 2016-05-16 17:17:34
Original
1978 people have browsed it

javascript alert()函数就是一个用于输入提示的功能,但今天在使用alert()提示时中文乱码,拼音什么的都没有问题呀,下面我在论坛找到一解决办法,下面与大家分享。
解决办法一:

复制代码代码如下:

echo ' ';
echo '';

解决办法一:
如果你是利用外部调用的话
复制代码代码如下:



如果js与页面编码不统计一也可能出现乱码了,解决办法是
charset="gb2312" 加在js中
复制代码代码如下:



问题解决了。
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!