B4J Question [ABMaterial] insert a custom HTML\JS text into the web pages ?

peacemaker

Expert
Licensed User
Longtime User
HI, All

Is there possibility to insert any HTML text line into all generating pages ?
Into BODY, or other place.
Say, code of 3rd party services.
 

MichalK73

Well-Known Member
Licensed User
Longtime User
You can include HTML code from version 4.96 so in 5.0 it is. I even use this method quite often and it works very cool.

How insert HTML w body ABMaterial:
    Dim source As String = File.ReadString(File.DirApp&"/help", m.Get("help"))
    'source is code HTML
    Dim e As ABMLabel
    e.Initialize(page, "help", "aaa",ABM.SIZE_A, False,"")
    e.TextAsRAWHTML = source
    page.Cell(1,3).AddComponent(e)
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Thanks. What about extra JS-code injecting ?
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
What about extra JS-code injecting ?
In BuildPage your can use:

B4X:
page.AddExtraJavaScriptFile("custom/JsBarcode.all.min.js")
page.AddExtraCSSString($".extraPadding {padding-left: 2rem !important} .extraPaddingCheck {padding-top: 6px;padding-bottom: 6px;padding-left: 2rem !important} .extraPaddingSwitch {padding-top: 6px !important;padding-bottom: 6px !important} .jsoned div p label{margin-right: 50px}"$)
page.AddExtraCSSFile("custom/mycss.css")
 
Upvote 0
Top