首页 \ 问答 \ 多个HTML页面和分页[关闭](Multiple HTML pages & Pagination [closed])

多个HTML页面和分页[关闭](Multiple HTML pages & Pagination [closed])

好的,所以目前我正在为我的小型网上商店从零开始创建一个网站,并且当我的产品页面出现时,我仍然陷入困境。 目前,我有1页显示我的所有50个产品。 我计划扩展我的产品,不希望有人滚动整个页面。 我想添加多个页面,您可以点击,我相信我可以通过分页来实现这一目标。 现在,这是我感到困惑的部分:说我每页只需要显示25个产品,我在第一页上添加了一个新项目 - 如何将项目“碰到”页面2,3等等? 我认为有一些功能可以实现这一点,但我能想到的唯一方法是将产品从一个页面手动移动到另一个页面上的蛮力方式。 有什么建议么??

目前,我的网站是用所有HTML / CSS编码的,我目前刚学会了如何使用PHP批量编辑网站的某些区域 - 我正处于学习阶段! 任何建议都会有帮助。 谢谢!


Okay, so currently I'm creating a website from scratch for my small online shop and am stuck on where to even begin when it comes to my Products page. Currently, I have 1 page that displays all 50 of my products. I plan on expanding my products and do not want someone to be scrolling down the whole page. I would like to add multiple pages that you can click through and I believe I can accomplish this through Pagination. Now, this is the part where I get confused : say I only want 25 products to be displayed per page and I add a new item to the first page - how do items get 'bumped' to the page 2, 3 etc.? I would imagine there is some function to accomplish this, but the only way I can think of is doing this the brute force way of manually moving a product out of one page and onto another. Any suggestions??

Currently, my website is coded in all HTML / CSS and I currently just learned how to use PHP to mass edit certain areas of the website -- I am in the learning stages! Any suggestions would help. Thanks!


原文:https://stackoverflow.com/questions/31254129
更新时间:2023-06-11 18:06

最满意答案

试试这个(它帮助我在Mac OS X上):

casperjs --debug=yes --ignore-ssl-errors=true --ssl-protocol=any XYZ.j

XYZ.js是你的文件。


All I needed to do was to have set "sslProtocol": "any" in the config.json file that I used. A proper way to set it can be found in my answer to this question.

相关问答

更多
  • 为了简单起见,将CasperJS视为获取数据并在使用另一种语言后处理数据的方式。 我会选择#1选项 - 以JSON格式获取数据,并将其保存到文件中以便稍后执行。 为此,您可以使用PhantomJS提供的文件系统API 。 你也可以将它与CasperJS的cli接口结合起来 ,让你将参数传递给脚本(例如写入的临时文件)。 处理所有这些的脚本看起来像: 获取临时文件路径(Linux系统上的mktemp )。 调用您的CasperJS脚本,将该临时文件路径作为参数传递。 获取您的数据,使用File System ...
  • 关于CasperJS和代码中的错误存在一些误解: 它是__utils__而不是_utils_ 。 __utils__仅在页面上下文中可用 。 可以通过casper.evaluate访问页面上下文 。 像DOM节点这样的非原始对象不能传递出页面上下文 。 (和参考 ) 如果您对href感兴趣,那么您必须从DOM元素中读取href属性。 casper.start是异步的,但是fs.write不是,所以你必须将fs.write调用放在另一个在casper.start之后执行的异步函数中。 JavaScript对象 ...
  • 试试这个(它帮助我在Mac OS X上): casperjs --debug=yes --ignore-ssl-errors=true --ssl-protocol=any XYZ.j XYZ.js是你的文件。 All I needed to do was to have set "sslProtocol": "any" in the config.json file that I used. A proper way to set it can be found in my answer to this ...
  • 当前网址为http://www.twse.com.tw/en/trading/exchange/STOCK_DAY/STOCK_DAY.php ,表示您在起始页面中被阻止并等待重定向,请更改您的 casper.then(function() { this.capture(filename); this.echo("Saved screenshot of " + (this.getCurrentUrl()) + " to " + filename); }); 至: casp ...
  • 只是一个注释,如果有人登陆这个问题 - 我在package.json和node-modules目录中有一个本地安装的npm'网页'模块我得到了同样的错误。 清除这些允许casperjs找到全局安装的幻像网页模块并为我修复此问题。 The problem turned out to be that I had a Phantom script called webpage.js in the directory from which I was trying to execute my Casper scri ...
  • 最后编写了以下脚本。 希望它对某些人有用。 EXIT_STATUS=0 SOURCE="${BASH_SOURCE[0]}" DIR="$( dirname "$SOURCE" )" echo 'killing processes using port 9999' PORT_NUMBER=9999 lsof -i tcp:${PORT_NUMBER} | awk 'NR!=1 {print $2}' | xargs kill echo 'starting server on 9999' grunt c ...
  • 在此之前我没有对此进行过regonized,但是你也得到了失败(第一个)相等的错误消息。 最后的PASS只是说casperjs已经完成了测试套件 ,无论套件内部出现什么故障。 这是完整的日志: root@4332425a143d:/casperjs# casperjs test test.js Test file: test.js # assertEquals() tests FAIL Subject equals the expected value # ty ...
  • 你在这里混淆了很多东西: __utils__是clientutils模块,仅在页面上下文中可用(在casper.evaluate()内部)。 页面上下文是沙箱,因此您不能使用外部变量或将DOM节点传递到外部。 CasperJS按步骤组织,但并非所有功能都是步进功能。 casper.click()是一个阻塞点击调用,但casper.back()是异步的。 casper.click()单击与选择器匹配的第一个元素,但由于每次迭代的选择器始终相同,因此每次都会单击相同的元素。 您必须跟踪已单击的元素。 这可以在页 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)