Home> php教程> php手册> body text

PHP变量赋值、代入给JavaScript中的变量

WBOY
Release: 2016-06-06 20:02:51
Original
1319 people have browsed it

这篇文章主要介绍了PHP变量赋值、代入给JavaScript中的变量,这也是在WEB开发中非常有用的功能技巧,使用的频率也非常高,需要的朋友可以参考下

复制代码代码如下:


$(document).ready(function(){


var t=;
alert(t)
})


复制代码代码如下:


$(document).ready(function(){


var t="";
alert(t)
})



复制代码代码如下:



关键是sd两旁既要加单引号还要加上引号否则就会显示
“sd is not defined
[在此错误处中断]
var t=sd;”
sd不加引号即为一个变量,之前没定义过该变量,就把他赋值给别的变量,当然会报错

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
Popular Recommendations
    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!