dp13668681869 2011-06-15 22:03
浏览 262

在php里面运行javascript?

I need to call arbitrary javascript functions from a page I download with a cURL session inside a php script. For example, on the site x4x4x.tk, I need to call updateLocation() (search for "updateLocation(this)" in the source). I can't have the script pop open a browser window and do it there, it needs to be done entirely from the command line.

I found an extension called v8js that looks like it would do what I need, but it requires php 5.3.3. The server the script will run on uses php 5.2.6-1 and I'm not in a position where I can update the server.

I found the extensions php-js and j4p5 and they look like they'll do what I want, but I wanted to check on here and see if anyone's tried to do anything like this before.

  • 写回答

3条回答 默认 最新

  • dongpo5207 2011-06-15 22:07
    关注

    JavaScript - Client Side
    PHP - Server Side.

    Best guess? Either translate the code, or open a browser window for the client to execute it. otherwise, you're not going to have a fun time getting a javascript file to execute via php/cURL.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?