Home > Backend Development > PHP Tutorial > PHP variable assignment, substitution into variables in JavaScript, assignment javascript_PHP tutorial

PHP variable assignment, substitution into variables in JavaScript, assignment javascript_PHP tutorial

WBOY
Release: 2016-07-13 09:48:19
Original
1043 people have browsed it

Assign values ​​to PHP variables and substitute them into variables in JavaScript, assign values ​​to javascript

Copy code The code is as follows:
$(document).ready(function(){


var t=;
alert(t)
})

or
Copy code The code is as follows:
$(document).ready(function(){


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

or
Copy code The code is as follows:

The key is that sd must be surrounded by single quotes and quotation marks, otherwise it will be displayed
“sd is not defined
[Break at this error] 
var t=sd;”
sd is a variable without quotes. If the variable has not been defined before, if it is assigned to another variable, of course an error will be reported

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1024131.htmlTechArticlePHP variable assignment, substitution into variables in JavaScript, assignment javascript copy code code is as follows: $(document).ready (function(){ php $f="'name'" var t=php echo $f; alert(t) }) or copy...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template