English 中文(简体)
PHP or jQuery/PHP pagination [los]
原标题:PHP or jQuery/PHP pagination [closed]
Closed. This question is off-topic. It is not currently accepting answers.

。 因此,在Stack Overflow的

Closed 11 years ago.

我写了一篇预写的PHP级,供阅读。 这一工作顺利进行,但随着我更多地把我的场地与格列斯和购买力平价结合起来,我感觉到有人敦促把PHP和j Query ajax电话结合起来。

我的问题或关切,以及任何有益的反馈都非常值得赞赏:

a) 基本假设是,如果我使用 j,我就不再有榜样产品。 php?page=2,但只是产品。 php作为 j,将用ja子在内容上,因此没有上页,而BUT并不要求实际的URL扫描到网页上? 谷歌如何将成果指数化?

b) 只有两种类型的辅导。 一种是,所有内容都从使用PHP的服务器中收集,然后将“分类”输入网页,使页数实际上在即刻上(初始负荷更长,而正用的是传单,而另一种是,根据用户的选择,独立使用亚克斯电话。 据认为,所有工作周期(载荷、低地轨道、用户经验)都是最佳的做法。

某些提及良好材料或辅导的内容将非常大!

问题回答

Just to question a): It s not fully true that you won t have those links any more because as you supposed correctly, there are some users without JS enabled and some crawlers like Google. So links like "products.php?page=2" will surely survive the next few years. But here is a possibility to combine SEO/users without JS and an AJAX possibility for those who have enabled it:

<a href="products.php?page=2" onclick="loadPage( products.php ,2);return false;">
 Next Page
</a>

EDIT:你还可以在onlclick上操作另一个PHP文字,可能的话是loadProductsFrom(获得产品.php,2);,根据该功能,应当把JSON产品目标从类似于James Smiths的服务器上装载,但通过AJRP向用户显示。 这可能减少交通和下载时间,但又造成一些(或更多)间接费用。 因此,在这种情况下,使用者的利益是显而易见的。

另一种选择是把你的所有数据装入一个javascript的物体,例如:

$strSql = "Select * from products";
$objResult = mysql_query($strSql);
$arrData = array();
while($objRow = mysql_fetch_array($objResult)){
 $objData = new stdClass();
 $objData->name = $objRow[ name ];
 /* add more data here */
 $arrData[] = $objData;
}
<script type="text/javascript">
var arrData =  <?php echo json_encode($arrData); ?> 
</script> 

Now you can pass this arrData to any jquery pagination plugin and it will take care of all the pagination work for you, since the data is in compressed form, load time will as well so your page will have a better search engine visibility.. hope this helps..





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签