代码如下 |
复制代码 |
$action=$_GET['action'];
echo "document.write('".$action."');n";
?>
|
There is this piece of PHP code in b.php:
PHP code
The code is as follows
|
Copy code
|
$action=$_GET['action'];
代码如下 |
复制代码 |
$("#myID").load("test.php");
|
echo "document.write('".$action."');n";
?>
代码如下 |
复制代码 |
$("#myID").load("test.php",{"name" : "Adam"});
|
When the a.html file is executed, the b.php file will be called, and the output of the b.php file will be executed as a JS statement. The content is the value of the parameter action passed by JS, which is accepted in the PHP file. The value of the passed action.
代码如下 |
复制代码 |
$("#myID").load("test.php",{"name" : "Adam" ,"site":www.bKjia.c0m});
//导入的php文件含有一个传递参数,类似于:test.php?name=Adam&site=www.bKjia.c0m
|
jquery’s load function is a call to request another file and load it into the current DOM
代码如下 |
复制代码 |
$("#myID").load("test.php",{‘myinfo[]‘, ["Adam", www.bKjia.c0m});
//导入的php文件含有一个数组传递参数。
|
|
1. Load a php file that does not contain passing parameters
The code is as follows
|
Copy code
|
$("#myID").load( "test.php");
2. Load a php file, which contains a passing parameter
The code is as follows
|
Copy code
|
$("#myID").load( "test.php",{"name" : "Adam"});
3. Load a php file that contains multiple passed parameters. Note: Separate parameters with commas
The code is as follows
|
Copy code
|
$("#myID").load( "test.php",{"name" : "Adam" ,"site":www.bKjia.c0m});
//The imported php file contains a passing parameter, similar to: test.php? name=Adam&site=www.bKjia.c0m
4. Load a php file that uses an array as a passing parameter
The code is as follows
|
Copy code
|
$("#myID").load("test.php",{‘myinfo[]‘, ["Adam", www.bKjia.c0m});
//The imported php file contains an array of passed parameters.
http://www.bkjia.com/PHPjc/633075.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/633075.htmlTechArticleThe static page looks good, but you can’t call the php file directly, but you can use the js calling method to call it. php file, of course you can also use ajax to call php files, let me give you...
|
|
|
|
|