<small id='CqOqz'></small><noframes id='CqOqz'>

      <bdo id='CqOqz'></bdo><ul id='CqOqz'></ul>
  • <legend id='CqOqz'><style id='CqOqz'><dir id='CqOqz'><q id='CqOqz'></q></dir></style></legend>

        <tfoot id='CqOqz'></tfoot>
        <i id='CqOqz'><tr id='CqOqz'><dt id='CqOqz'><q id='CqOqz'><span id='CqOqz'><b id='CqOqz'><form id='CqOqz'><ins id='CqOqz'></ins><ul id='CqOqz'></ul><sub id='CqOqz'></sub></form><legend id='CqOqz'></legend><bdo id='CqOqz'><pre id='CqOqz'><center id='CqOqz'></center></pre></bdo></b><th id='CqOqz'></th></span></q></dt></tr></i><div id='CqOqz'><tfoot id='CqOqz'></tfoot><dl id='CqOqz'><fieldset id='CqOqz'></fieldset></dl></div>

        在 ajax 调用后加载视图,CodeIgniter

        loading a view after an ajax call, CodeIgniter(在 ajax 调用后加载视图,CodeIgniter)
          <tbody id='PSp5z'></tbody>

              • <i id='PSp5z'><tr id='PSp5z'><dt id='PSp5z'><q id='PSp5z'><span id='PSp5z'><b id='PSp5z'><form id='PSp5z'><ins id='PSp5z'></ins><ul id='PSp5z'></ul><sub id='PSp5z'></sub></form><legend id='PSp5z'></legend><bdo id='PSp5z'><pre id='PSp5z'><center id='PSp5z'></center></pre></bdo></b><th id='PSp5z'></th></span></q></dt></tr></i><div id='PSp5z'><tfoot id='PSp5z'></tfoot><dl id='PSp5z'><fieldset id='PSp5z'></fieldset></dl></div>

                <small id='PSp5z'></small><noframes id='PSp5z'>

              • <tfoot id='PSp5z'></tfoot>
                  <bdo id='PSp5z'></bdo><ul id='PSp5z'></ul>
                  <legend id='PSp5z'><style id='PSp5z'><dir id='PSp5z'><q id='PSp5z'></q></dir></style></legend>

                • 本文介绍了在 ajax 调用后加载视图,CodeIgniter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个从 javascript 到控制器中的方法的 ajax 调用,控制器中的方法应该加载一个视图(比如,在屏幕上显示一个新页面),虽然一切看起来都很好,但新视图没有似乎加载在屏幕上.我不能使用 header 或 windows.location 因为,我正在传递一个数组变量,其中包含要在视图中使用的数据.

                  I have an ajax call from javascript to a method in a controller, the method in the controller should be loading a view(like, show a new page on the screen), Although everything seems ok, the new view doesn't seem to load on the screen. I cannot use header or windows.location because, i am passing an array variable, containing data to be used in the view.

                  该页面在 Chrome 调试控制台的网络选项卡(预览子选项卡,同时选择 ajax)下可见.但主屏幕保持原样.

                  The page is visible under the Network tab (preview sub tab, while selecting the ajax) of the Chrome debugging console. But the main screen stays as it is.

                  如果有人遇到过类似的问题,或者有解决方案,请帮助我.

                  If somebody has faced a similar issue, or has a solution, please help me.

                  谢谢!!

                  推荐答案

                  好的,这就是你做错的地方.

                  Ok here is what you are doing wrong.

                  当您使用 ajax 请求页面时,它不会返回该页面.

                  when you request the page using ajax it does not return you that page.

                  当你使用 $this->load->view('pagename',$datapassed);它加载了视图,这就是为什么你什么也看不到的原因.

                  When you use $this->load->view('pagename',$datapassed); it loads the view and that's why you see nothing.

                  你要做的就是使用

                  $data=$this->load->view('pagename',$datapassed, TRUE);
                  

                  它会做的是,它会返回那个页面并将其保存在 $data 中之后,您可以使用

                  What it will do is, it will return that page and save it in $data after that you can print it using

                  $this->set_output($data); 
                  

                  并在ajax结果中接收它并将其加载到div中.

                  and receive this in ajax result and load it in a div.

                  如果你想刷新整个页面,你可以使用

                  and if you want to refresh the whole page you can use

                  $(body).html(result);
                  

                  您必须了解您需要通过在加载视图中提供第三个参数来发送 html 页面.

                  You have to understand that you need to send the html page by supplying that third parameter in load view.

                  这篇关于在 ajax 调用后加载视图,CodeIgniter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                    <tfoot id='BXpip'></tfoot>

                    • <bdo id='BXpip'></bdo><ul id='BXpip'></ul>
                      <legend id='BXpip'><style id='BXpip'><dir id='BXpip'><q id='BXpip'></q></dir></style></legend>

                        <tbody id='BXpip'></tbody>
                        • <small id='BXpip'></small><noframes id='BXpip'>

                        • <i id='BXpip'><tr id='BXpip'><dt id='BXpip'><q id='BXpip'><span id='BXpip'><b id='BXpip'><form id='BXpip'><ins id='BXpip'></ins><ul id='BXpip'></ul><sub id='BXpip'></sub></form><legend id='BXpip'></legend><bdo id='BXpip'><pre id='BXpip'><center id='BXpip'></center></pre></bdo></b><th id='BXpip'></th></span></q></dt></tr></i><div id='BXpip'><tfoot id='BXpip'></tfoot><dl id='BXpip'><fieldset id='BXpip'></fieldset></dl></div>