Nesting of php and javascrip. I am a vc programmer. Not long ago, due to actual needs, I learned php and javascript. Since these two languages are very similar to the c and c ++ syntaxes, I didn't have to spend much time to "get it done. I am a vc programmer. Not long ago, due to actual needs, I learned php and javascript. Since these two languages are very similar to the c and c ++ syntaxes, I didn't have to spend much time to "get it done.
I usually use javascript to customize the webpage layout, and then use php to perform various database operations. The relationship between the two languages is not like the relationship between mfc and windows api functions. it can be "seamlessly" transplanted, so I often encounter difficulties in practical use, here I will give a brief introduction to the issues that need to be paid attention to during the nesting of php and javascrip.
Example 1:
Example 2:
/BODY>
Comment:
The result returned by Example 2 is correct, that is, the user closes the form window when submitting the form.
However, the error message "a is not identified" is displayed in the example 1, that is, a is not defined.
The reason is that the scope of the window handle a (for the time being, let me say so) cannot set the "information" (that is, the value of a) of)
"Pass" to the new window. Therefore, only window. close () can be used, and the window handle uses the default current value.
Bytes. Not long ago, due to actual needs, I learned php and javascript. Since these two languages are very similar to the c and c ++ syntaxes, I didn't have to spend much time to "get it done. I'm...