Home > Backend Development > PHP Tutorial > Nesting of php and javascript_PHP tutorial

Nesting of php and javascript_PHP tutorial

WBOY
Release: 2016-07-13 17:23:27
Original
869 people have browsed it

I am a vc programmer. Not long ago, I learned php and javascript due to practical needs. Since the syntax of these two languages ​​is very similar to that of c and c++, it didn't take me much effort to "get it".
I usually use javascript to customize the web page layout, and then use php to perform various database operations. The relationship between these two languages ​​is not like the relationship between MFC and Windows API functions, which can be "seamlessly" transplanted, so I often encounter difficulties in practical application. Here I will embedding PHP and Javascript. The issues that should be paid attention to in the set are briefly mentioned.
Routine 1:



Routine 2:



/BODY>

Comments:
Routine 2 can achieve the correct result, that is, the user will close the form window when submitting the form.
But routine 1 will get the error message "a is not identified", that is, a is not defined.
The reason is that the scope of window handle a (let me put it this way for now) cannot
"transmit" the "information" of a (that is, the value of a) to the newly created window. So you can only use window.close() and the window handle uses the default current value.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532228.htmlTechArticleI am a vc programmer. Not long ago, I learned php and javascript due to practical needs. Since the syntax of these two languages ​​is very similar to that of c and c++, it didn't take me much effort to "get it". I...
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