Php and javascrip nested _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.