Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/298.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用jQuery加载页面_Php_Jquery_Ajax - Fatal编程技术网

Php 使用jQuery加载页面

Php 使用jQuery加载页面,php,jquery,ajax,Php,Jquery,Ajax,我正在使用jQuery。我的主页是index.php。加载此页面时。如何在内部加载另一个页面。在页面中说一个小块?如下:$('.smallBlock').load('targetUnderNameDomain.php.anotherSmallBlock') 在第一部分中,选择要插入目标文件块的块。 加载功能有两部分: 第一部分是选择目标文件的地方,第二部分是可选的,但是可以在目标文件的html中选择元素。如下:$('.smallBlock').load('targetUnderSameDomai

我正在使用
jQuery
。我的主页是
index.php
。加载此页面时。如何在内部加载另一个页面。在页面中说一个小块?

如下:
$('.smallBlock').load('targetUnderNameDomain.php.anotherSmallBlock')

在第一部分中,选择要插入目标文件块的块。 加载功能有两部分: 第一部分是选择目标文件的地方,第二部分是可选的,但是可以在目标文件的html中选择元素。

如下:
$('.smallBlock').load('targetUnderSameDomain.php.anotherSmallBlock')

在第一部分中,选择要插入目标文件块的块。 加载功能有两部分:
第一部分是选择目标文件的地方,第二部分是可选的,但是可以在目标文件的html中选择元素。

可以使用load命令。对于这样的简单页面:

<html>
<head>
   <title>test</title
</head>
<body>
   <div id="content"> </div>
</body>
</html>
$('#content').load('yourUrl.php');
编辑:从get()更改为load()

get命令的语法为:

$.get('yourUrl.php', function(data){
   $('#content').html(data);
 });

可以使用load命令。对于这样的简单页面:

<html>
<head>
   <title>test</title
</head>
<body>
   <div id="content"> </div>
</body>
</html>
$('#content').load('yourUrl.php');
编辑:从get()更改为load()

get命令的语法为:

$.get('yourUrl.php', function(data){
   $('#content').html(data);
 });

是一个不同的函数,你想在这里:)是的,你的权利。。。我猜我的大脑在星期天工作得不太好;)我们不能在这里使用.get(),这也会获取数据吗?。。。我可以将参数传递给.load()函数吗?是一个不同的函数,你想在这里:)是的,你的权利。。。我猜我的大脑在星期天工作得不太好;)我们不能在这里使用.get(),这也会获取数据吗?。。。我可以将参数传递给.load()函数吗?