这个javascript可以被纯PHP取代吗? [英] Can this javascript be replaced by pure PHP ?

查看:59
本文介绍了这个javascript可以被纯PHP取代吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何解释这个动作,基本上一个网页会显示

一个简短的格式,并且会有一个链接说显示更多当

点击更多文字显示。例如。 goto

http://www.newegg.com/app/ViewProduc...19-101&depa=10


并向下滚动至客户评论,你会看到一些评论有一个名为See complete的

链接 - 这就是我想要的动作。他们正在做javascript的

。有没有办法用纯PHP做到这一点?


谢谢

I don''t know how to explain this action, basically a web page will show
a brief format and there''ll be a link the says "show more" and when
clicked more text shows. eg. goto

http://www.newegg.com/app/ViewProduc...19-101&depa=10

and scroll down to the customer reviews, you''ll see some reviews have a
link named "See complete" - and that''s the action I want. They are doing
that will javascript. Is there a way to do this with pure php?

Thanks

推荐答案

>
http:// www .newegg.com / app / ViewProduc ... 19-101& depa = 10

并向下滚动到客户评论,你会看到一些评论有
a链接名为查看完整链接 - 这就是我想要的动作。他们是
这样做javascript。有没有办法用纯PHP做到这一点?

and scroll down to the customer reviews, you''ll see some reviews have a link named "See complete" - and that''s the action I want. They are doing that will javascript. Is there a way to do this with pure php?




关于你可以做这个服务器端的唯一方法是重新绘制

整页。也就是说,看完了。链接只是< a

href =" mypage.php?open = 1">见完整< / a>并且您的页面将检查



About the only way you could do this server-side is by repainting the
entire page. That is, the "See complete" link would simply be <a
href="mypage.php?open=1">See complete</a> and your page would check for


_REQUEST [''open''] == 1并有条件地绘制整个文本。


--cd
_REQUEST[''open'']==1 and conditionally paint the entire text.

--cd


同样出现leegold2:
Also sprach leegold2:
http://www.newegg.com/app/ViewProduc...19-101&depa = 10
并向下滚动到客户评论,你会看到一些评论有一个名为See complete的链接。 - 这就是我想要的动作。他们正在做javascript。有没有办法用纯PHP做到这一点?
http://www.newegg.com/app/ViewProduc...19-101&depa=10
and scroll down to the customer reviews, you''ll see some reviews have
a link named "See complete" - and that''s the action I want. They are
doing that will javascript. Is there a way to do this with pure php?




当然。我想这些评论是从数据库中读取的,并且要显示

要么完成,要么完成。或不完整。为PHP中的每个评论分配一个ID和

使查看完成链接类似
http://foo.bar /page.php?showcomplete=id&showothers=xxx ,其中id是id

此评论和xxx以某种方式表示其他评论的状态

(例如二进制数,其中设置/重置位表示相应的

检查完成/不完整)。然后让您的PHP脚本查找

变量showcomplete和showothers并使用此信息生成

页面,包括查看完整和链接更新的showothers

变量。可能有其他方法可以达到相同的效果,但这是我首先想到的那个。



Sure. The reviews are read from a database, I suppose, and are to be shown
either "complete" or "incomplete". Assign an id to each review in PHP and
make the "See complete" links something like
http://foo.bar/page.php?showcomplete=id&showothers=xxx, where id is the id
of this review and xxx somehow represents the state of the other reviews
(e.g. a binary number where set/reset bits mean that the corresponding
review is complete/incomplete). Then have your PHP script look for the
variables showcomplete and showothers and use this information to generate
the page, including the "See complete" links with the updated showothers
variable. There may be other ways to achieve the same result, but this is
the one that first came to my mind.


这篇关于这个javascript可以被纯PHP取代吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆