简体   繁体   English

Codeigniter-Ajax如何将数据显示到HTML页面

[英]Codeigniter - Ajax How to Display data to HTML Page

Currently I am developing a Hybrid mobile application using phonegap. 目前,我正在使用phonegap开发混合移动应用程序。 And I use PHP for making my app Dynamic (in Back end). 然后,我使用PHP使我的应用程序动态化(在后端)。 I use below steps for my app development: 我使用以下步骤进行应用开发:

  • First i Create HTML Page and Give id to Div Tag for display Data 首先,我创建HTML页面并将ID赋予Div标签以显示数据
  • After Add Jquery File in HTML Page. 在HTML页面中添加Jquery文件之后。

    $(document).ready(function() { GolbalURL = $.session.get('URL'); $.ajax({ type: "GET", url: GolbalURL+"ftp.php",
    dataType: "html",
    success: function(response){
    $("#divprofile").html(response); } }); });

  • After that I create one php file Add My Connection Data, Loops and other Dynamic PHP code in that file. 之后,我创建一个php文件,在该文件中添加我的连接数据,循环和其他动态PHP代码。
  • This Working With Phonegap When I run on Emulator even on Browser. 当我在模拟器上甚至在浏览器上运行时,都可以使用Phonegap。

But my problem is that, my existing website is in Codeigniter and for any code level change in Codeigniter requires changes in phonegap files as well. 但是我的问题是,我现有的网站在Codeigniter中,并且对于Codeigniter中的任何代码级别更改,都需要更改phonegap文件。

Is there any way that I can use Codeigniter's output in my app's HTML like I use PHP files output in my HTML page via AJAX. 有什么方法可以像在AJAX中使用HTML页面中的PHP文件输出一样,在应用程序的HTML中使用Codeigniter的输出。

Thanks in Advanced. 提前致谢。

Edit No Iframe 编辑无iframe

If I understood well, 如果我听得懂
you want to load a complete HTML web page on your application. 您想要在应用程序上加载完整的HTML网页。 if so, just install InAppBrowser Plugin https://cordova.apache.org/docs/en/3.0.0/cordova_inappbrowser_inappbrowser.md.html and read the documentation 如果是这样,只需安装InAppBrowser Plugin https://cordova.apache.org/docs/en/3.0.0/cordova_inappbrowser_inappbrowser.md.html并阅读文档

您可以使用iframe来显示您的codeigniter网页。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM