【问题标题】:Adding external Link using ckeditor to ionic mobile applicaion使用ckeditor将外部链接添加到离子移动应用程序
【发布时间】:2015-08-05 22:54:47
【问题描述】:

我有一个 php 管理员使用 ionic 框架为移动应用程序创建内容,一切正常。 但我有一个小问题。 当管理员创建内容并放置外部链接时,此链接不起作用,甚至看起来像移动应用程序中的链接。

这是我在请求页面时从 php 得到的

{
  "id": "1",
  "created_date": "2015-05-19 09:09:39",
  "title": "Grade 12 Graduation Ceremony",
  "description": "<p><a href=\"http:\/\/ais.arrowad.sch.sa\/index.php?option=com_tz_portfolio&amp;view=article&amp;id=249:ais-igcse,-as,-a2-and-american-diploma-overview%E2%80%8F&amp;catid=41&amp;Itemid=538&amp;lang=en\">AIS IGCSE, AS, A2 and American Diploma Overview&rlm;<\/a></P
",
  "image": "1432012362.jpg",
  "thumbail": "",
  "lang": "all",
  "date": "2015-05-19",
  "timestamp": "1432044579"
}

我正在像这样打印 html: 在控制器中

 angular.module('App')
        .filter('to_trusted', ['$sce', function($sce){
            return function(text) {
                return $sce.trustAsHtml(text);
            };
        }]);

在html中

<div ng-bind-html="data.content| to_trusted"></div>

所以链接不可点击,即使我尝试将链接设为 javascript“OnClick”,但问题相同

有什么帮助吗? 谢谢

【问题讨论】:

    标签: javascript php jquery angularjs ionic-framework


    【解决方案1】:

    看看你的链接是如何呈现的:

      "description": "<p><a href=\"http:\/\/ais.arrowad.sch.sa\/index.php?option=com_tz_portfolio&amp;view=article&amp;id=249:ais-igcse,-as,-a2-and-american-diploma-overview%E2%80%8F&amp;catid=41&amp;Itemid=538&amp;lang=en\">AIS IGCSE, AS, A2 and American Diploma Overview&rlm;<\/a></P
    

    结束标签已损坏:

    <\/a></P
    

    正常的 html 链接应如下所示:

     &lt;a href="www.example.com"&gt;This is my link&lt;/a&gt;

    【讨论】:

    • 那该怎么办呢?如果我在浏览器中打印它就可以工作
    • 如何展示内容?在浏览器中还是在自定义移动应用程序中?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-25
    • 1970-01-01
    相关资源
    最近更新 更多