dongmao7195 2016-02-13 14:22
浏览 15

(ZEND)在javascript中路由到index.phtml

I'm making a button that refreshes a specific div, the div is located in the index.phtml.

 $('#jumbotron-table').load(document.URL);

Is not working, nothing happens.

  • 写回答

1条回答 默认 最新

  • doulianglou0898 2016-02-13 14:48
    关注

    Firstly, it would help if you specify exactly what "not working" means. Does anything happen on-screen?, is there an error message in the Javascript console?, if you enter the fuction in immediate mode into the debugger does it work then?, what if you use a fixed URL rather than a variable?

    document.URL is the URL of the currently loaded page, so you're loading a copy of the current page into a div within that page. Sounds a bit odd but I can't say that it sounds impossible.

    Try something like this-

    <script type="text/javascript" src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
    
    <html>
        <table id="myTable"><tr><td>Content</td></tr></table>
    </html>
    
    <script>
    var contentURL= "Stackoverflow_01.html";
    
    $().ready(function() {
      $('#myTable tr td').load(contentURL);
    });
    
    </script>
    

    This loads the content of the target file into a table cell in the starting file.

    评论

报告相同问题?

悬赏问题

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