Re: [polymer-dev] Iroin-ajax response with html tags

20 views
Skip to first unread message
Message has been deleted

Karl Tiedt

unread,
Jul 28, 2016, 3:47:37 PM7/28/16
to nawras albaghdadi, Polymer
Please don't repeat questions with new subjects, it just creates extra noise and makes finding answers harder for others who may be searching archives.

-Karl Tiedt

2016-07-28 4:47 GMT-07:00 nawras albaghdadi <nawras.a...@gmail.com>:
I'm getting a JSON feed by iron-ajax, in the returned JSON come with HTML tags like this.
[{
pk 
:1,
  • body"<p>ثم سكان بشرية الأبرياء عدد, كلّ يقوم الطرفين و. وبدأت انذار عل بحق, تكبّد إستيلاء الأثناء، دنو بـ, عالمية العالم، بالمطالبة قد الى. وزارة السبب التّحول فصل بل, كل والتي واشتدّت وايرلندا بعض. إحتار واندونيسيا، بلا لم, بوابة الفترة بين بل. </p> <p>ثم سكان بشرية الأبرياء عدد, كلّ يقوم الطرفين و. وبدأت انذار عل بحق, تكبّد إستيلاء الأثناء، دنو بـ, عالمية العالم، بالمطالبة قد الى. وزارة السبب التّحول فصل بل, كل والتي واشتدّت وايرلندا بعض. إحتار واندونيسيا، بلا لم, بوابة الفترة بين بل.".</p> <p>ثم سكان بشرية الأبرياء عدد, كلّ يقوم الطرفين و. وبدأت انذار عل بحق, تكبّد إستيلاء الأثناء، دنو بـ, عالمية العالم، بالمطالبة قد الى. وزارة السبب التّحول فصل بل, كل والتي واشتدّت وايرلندا بعض. إحتار واندونيسيا، بلا لم, "بوابة" الفترة بين بل.</p> <!-- Images Box --><div class="img_box01"> <img class="img-responsive" src="url" alt=""><p>عبد المالك نبيل بوتيجان</p> </div> <!-- Video --><div class="box video_box"><div class="head"><h2></h2></div> <p>وأدرج بوتيجان على قائمة التطرف منذ 29 حزيران/يونيو لمحاولته التوجه إلى سوريا مرورا بتركيا، بحسب مصدر قريب من التحقيق.<br /> كما أن المنفذ الثاني يشبه إلى حد كبير مشتبها به تبحث عنه السلطات منذ 22 تموز/يوليو أي قبل ثلاثة أيام من الاعتداء الذي تم في كنيسة سانت اتيان دو روفريه بالقرب من روان (شمال غرب).</p> <p>وكان جهاز أجنبي أبلغ هيئة تنسيق مكافحة الإرهاب بوجود رجل لم تعرف هويته "مستعد للمشاركة في اعتداء على الأراضي الفرنسية"، وأرفقت بالبلاغ صورة لشخص يشبه كثيرا عبد المالك بوتيجان.</p> <!-- Images Box --><div class="img_box01"> <img class="img-responsive" src="url" alt=""><p>عبد المالك نبيل بوتيجان</p> </div> <!-- Video --><div class="box video_box"><div class="head"><h2></h2></div><div class="content"><div class="arena"><video id="url" dir="ltr" class="video-js vjs-big-play-centered vjs-default-skin" controls preload="auto" width="600" height="338" poster=""><source src="url" type="video/mp4"></source><track kind="captions" src="" srclang="en" label="English"><track kind="captions" src="" srclang="ar" label="Arabic" default><p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading your web browser</p></track></track></video></div></div><div class="foot"></div></div>",
}]

so I create a dom-repeat element to show the results , but when printing the [[body]] , it prints out as text with the HTML tags as text also, so how to print it out as HTML without facing XSS security .

Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/2d216c64-5277-4403-ba38-4d793c97b39e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tomek W

unread,
Jul 28, 2016, 6:11:05 PM7/28/16
to Polymer
You may find those two elements useful:

They let you include safe HTML, or load partial from external files - with Polymer data-binding still working.

BR,
Tomek Wytrębowicz
Reply all
Reply to author
Forward
0 new messages