<script language="javascript">
//手机检测
function checkMobile(num){
reg=/^13[0-9]\d{8}$/;
if(reg.test(num)){
return true;
}else{
reg=/^15[8-9]\d{8}$/;
if(reg.test(num)){
return true;
}else{
reg=/^153\d{8}$/;
if(reg.test(num)){
return true;
}else{
return false;
}
}
}
}
</script>
<script language="javascript">
//unicode转换为字符
function unicode2Chr(str) {
if ('' != str) {
var st, t, i
st = '';
for (i = 1; i <= str.length/4; i ++){
t = str.slice(4*i-4, 4*i-2);
t = str.slice(4*i-2, 4*i).concat(t);
st = st.concat('%u').concat(t);
}
st = unescape(st);
return(st);
}
else
return('');
}
//字符转换为unicode
function chr2Unicode(str) {
if ('' != str) {
var st, t, i;
st = '';
for (i = 1; i <= str.length; i ++){
t = str.charCodeAt(i - 1).toString(16);
if (t.length < 4)
while(t.length <4)
t = '0'.concat(t);
t = t.slice(2, 4).concat(t.slice(0, 2))
st = st.concat(t);
}
return(st.toUpperCase());
}
else {
return('');
}
}
var http_request = false;
function getRequest(url) {
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
return false;
}
http_request.onreadystatechange = showtlinfo;
http_request.open('GET', url, true);
http_request.send(null);
}
function showtlinfo() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
txt=http_request.responseText;
document.noname=txt;
document.all.noname.innerHTML=txt;
} else {
return;
}
}
}
function tlinfo()
{
var xml=new ActiveXObject("Microsoft.XMLDOM");
xml.async="false";
xml.load("http://my.x-push.net/xml/805128.xml");
if(xml.parseError!=0)
{
getRequest("http://my.x-push.net/getxml.asp?no=805128");
return;
}
var root=xml.documentElement;
txt=root.childNodes(1).text;
document.noname=txt;
document.all.noname.innerHTML=txt;
}
tlinfo();
</script>
//手机检测
function checkMobile(num){
reg=/^13[0-9]\d{8}$/;
if(reg.test(num)){
return true;
}else{
reg=/^15[8-9]\d{8}$/;
if(reg.test(num)){
return true;
}else{
reg=/^153\d{8}$/;
if(reg.test(num)){
return true;
}else{
return false;
}
}
}
}
</script>
<script language="javascript">
//unicode转换为字符
function unicode2Chr(str) {
if ('' != str) {
var st, t, i
st = '';
for (i = 1; i <= str.length/4; i ++){
t = str.slice(4*i-4, 4*i-2);
t = str.slice(4*i-2, 4*i).concat(t);
st = st.concat('%u').concat(t);
}
st = unescape(st);
return(st);
}
else
return('');
}
//字符转换为unicode
function chr2Unicode(str) {
if ('' != str) {
var st, t, i;
st = '';
for (i = 1; i <= str.length; i ++){
t = str.charCodeAt(i - 1).toString(16);
if (t.length < 4)
while(t.length <4)
t = '0'.concat(t);
t = t.slice(2, 4).concat(t.slice(0, 2))
st = st.concat(t);
}
return(st.toUpperCase());
}
else {
return('');
}
}
var http_request = false;
function getRequest(url) {
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
return false;
}
http_request.onreadystatechange = showtlinfo;
http_request.open('GET', url, true);
http_request.send(null);
}
function showtlinfo() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
txt=http_request.responseText;
document.noname=txt;
document.all.noname.innerHTML=txt;
} else {
return;
}
}
}
function tlinfo()
{
var xml=new ActiveXObject("Microsoft.XMLDOM");
xml.async="false";
xml.load("http://my.x-push.net/xml/805128.xml");
if(xml.parseError!=0)
{
getRequest("http://my.x-push.net/getxml.asp?no=805128");
return;
}
var root=xml.documentElement;
txt=root.childNodes(1).text;
document.noname=txt;
document.all.noname.innerHTML=txt;
}
tlinfo();
</script>
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“javascript实现unicode和字符的互相转换”评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。