Pete Nellmapius
Posts: 0
Joined: Thu Sep 05, 2013 1:24 pm

Assign HTML text to the HTML Component in Javascript

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.

Pete Nellmapius
Posts: 0
Joined: Thu Sep 05, 2013 1:24 pm

Assign HTML text to the HTML Component in Javascript

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?

Pete Nellmapius
Posts: 0
Joined: Thu Sep 05, 2013 1:24 pm

Assign HTML text to the HTML Component in Javascript

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)

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Assign HTML text to the HTML Component in Javascript

Hi Pete,

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

Kittie Kat
Posts: 0
Joined: Wed Oct 02, 2013 10:12 am

Assign HTML text to the HTML Component in Javascript

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.

Kittie Kat
Posts: 0
Joined: Wed Oct 02, 2013 10:12 am

Assign HTML text to the HTML Component in Javascript

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.

Pete Nellmapius
Posts: 0
Joined: Thu Sep 05, 2013 1:24 pm

Assign HTML text to the HTML Component in Javascript

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?

Oleg Danchenkov
Posts: 0
Joined: Tue Apr 30, 2013 5:51 pm

Assign HTML text to the HTML Component in Javascript

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

Pete Nellmapius
Posts: 0
Joined: Thu Sep 05, 2013 1:24 pm

Assign HTML text to the HTML Component in Javascript

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

Return to “Issues”