Page 1 of 1

Assign HTML text to the HTML Component in Javascript

Posted: Wed Oct 02, 2013 7:45 am
by Pete Nellmapius

I need to assign HTML text to the component.
I tried Appery('html_Component').text(varWithHTMLCode);
The Component then displays the HTML code where I want it to display the processd HTML code.


Assign HTML text to the HTML Component in Javascript

Posted: Wed Oct 02, 2013 8:09 am
by Pete Nellmapius

I just found out that:
Appery('html_Component').append(varWithHTMLCode); works.
unfortunately append adds to the content.

The next question is want to replace the html data with contents of varWithHTMLCode

Is there no documentation describing the Methods for the Standard Appery.io Componants?


Assign HTML text to the HTML Component in Javascript

Posted: Wed Oct 02, 2013 8:15 am
by Pete Nellmapius

Sorry about this but I keep answering my own questions.

The following code works great:
// first initialise the data.
Appery('html_Component').text("");
// Then Append the new html data.
Appery('html_Component').append(varWithHTMLCode)


Assign HTML text to the HTML Component in Javascript

Posted: Wed Oct 02, 2013 9:21 am
by Kateryna Grynko

Hi Pete,

Unfortunately, no documentation.
Here is the solution: http://webdesignfan.com/htmlspecialch...


Assign HTML text to the HTML Component in Javascript

Posted: Wed Oct 02, 2013 10:12 am
by Kittie Kat

Thanks for the help Katya
I have noticed that the HTML Component does not show the URLs in another color and underlined like normal browsers do. The Cursor however changes when it hovers over a URL.


Assign HTML text to the HTML Component in Javascript

Posted: Wed Oct 02, 2013 10:12 am
by Kittie Kat

Thanks for the help Katya
I have noticed that the HTML Component does not show the URLs in another color and underlined like normal browsers do. The Cursor however changes when it hovers over a URL.


Assign HTML text to the HTML Component in Javascript

Posted: Wed Oct 02, 2013 12:56 pm
by Pete Nellmapius

Thanks for the help Katya.

I notice that the HTML component does not Style the URL's into another underlined color. However the Cursor changes to a hand when it is hovered over a URL. How do we get it to Show the urls like normal web browsers?


Assign HTML text to the HTML Component in Javascript

Posted: Wed Oct 02, 2013 3:08 pm
by Oleg Danchenkov

1) Instead of
code
Appery('html_Component').text("");
Appery('html_Component').append(varWithHTMLCode);
/code
try this
code
Appery('html_Component').html(varWithHTMLCode);
/code
2) "HTML component does not Style the URL's into another underlined color"
This css style is defined in mobilebase.css
code
a {
outline: none;
text-decoration: none;
color: black;
}
/code
You can rewrite this css rule. For example, create new CSS Asset with this code
code
[name="html_Component"] a {
text-decoration: underline !important;
color: blue !important;
}
/code


Assign HTML text to the HTML Component in Javascript

Posted: Thu Oct 03, 2013 3:29 pm
by Pete Nellmapius

Thanks Oleg
you just opened up a new door for me.
All is working...