ckeditor display <p>Text</p> instead of displaying HTML - codeigniter

Ck-editor is not displaying my content as HTML instead it displaying with HTML tags.
I have initialize ck-editor by below code:
$(document).ready(function() {
CKEDITOR.replace('long_description');
});

Please check form_helper file. May be html_escape will be problematic. Please try by removing this html_escape and let me know if it works.

Related

How to add attributes for <script> tag in HAML using CoffeeScript?

I'm using HAML with Coffeescript and have an issue with custom tag <script> being added.
I have index.haml with some content:
%h1 Some text
:coffee
$ ->
$('.some_html_elm').some_function;
...
This markup is generating HTML with a <script> tag.
I need to add an attribute data-turbolinks-eval=false (code-examples.net/en/q/13ba02e) to the <script> tag, but I can`t find a solution.
How can I do that?
My bad :(
You should use $(document).on 'turbolinks:load', -> for this case without any additional attributes

How to add HTML textarea tag into ckeditor widget?

I have HTML textarea. I want to add this HTML tag into ckeditor textarea.
How to add textarea tag into ckeditor widget?
Your question is not fully understandable. From my understanding, I guess you are trying to make your text area into CKEDITOR.
You can use CKEDITOR in different ways. Check the link to get their JS to implement
it.
To make a text area into CKEDITOR simply use this code.
//how you r calling your ckeditor js depends on you. here i am using their cdn.
//and yeah height is optional.
<script src="https://cdn.ckeditor.com/4.10.1/standard/ckeditor.js"></script>
<script type="text/javascript">
CKEDITOR.replace('id_of_textarea', {height: 150});
</script>

How to add more html to sweetalert after html to content update?

I saw previously you could edit the html portion of the sweetalert, but now that has been changed to content instead of doing raw html. Is there a way to go back to using html or another way of adding in an input. I saw in another post that it may be better to just use a modal instead.
https://github.com/sweetalert2/sweetalert2/issues/451 here is the guide with the html.
You are using SweetAlert2.
The plain HTML option still exists.
This is used as follows:
swal({
title: 'Title',
html: 'A custom <span style="color: #F8BB86">html<span> message.'
});
Javascript Sweet Alert and html link inside text

CKEditor HTML Autocorrection Issue

I have few lines of HTML in my database. I want to edit the content in CKEditor. But when I open that in editor the HTML gets break down. The HTML gets rearranged.
Below is the HTML which is in database:
<span class="sec_title">
<h1><span>Web</span> Engineering</h1>
<hr>
</span>
And when I open it in CKEditor the HTML looks likes below:
<h1><span class="sec_title"><span>Web</span> Engineering</span></h1>
<hr />
Some one please help me. I tried config.allowedContent = true; but it is also not stopping the CKEditor to do the modifications.
CKEditor works with a valid HTML only and <h1> is not a valid content of <span>. Quoting CKEditor basic concepts:
CKEditor is not a tool that will let you input invalid HTML code. CKEditor abides by W3C standards so it will modify code if it is invalid.

How to load script and html content from a url using jquery?

I have a html page in which i have a div where i need to load content from another page, which contains javascript and html. if i load as plain html, the html doesn't work.
so is there anyway make the javascript to work the way it has to and the html too when loading it using ajax.
<script type="text/javascript">
$(document).ready(function(){
$("#myDiv").load("myPage.html");
});
</script>
If I'm reading this properly, then you might not be-able to do this, there are all sorts of mechanisms to stop javascript from accessing data from other places, due to security concerns.
However, can you not simply just use an IFrame ?
$(document).ready(function(){
$('#result').load('ajax/test.html'); });
else try this
$('#result').load('ajax/test.html', function() {
alert('Load was performed.'); });

Resources