Forum Stats

  • 3,781,260 Users
  • 2,254,496 Discussions
  • 7,879,625 Comments

Discussions

how to add <script> tag inside outputHtml component

SCRUM_DEVELOPER95
SCRUM_DEVELOPER95 Member Posts: 55
edited Dec 24, 2017 1:23PM in Mobile Application Framework

Hello maf community,
I want to add a google map inside outputHtml in my amx page.
I know that I do not have permission to add <script> tag inside outputHtml  component, so I included a javascript file in my maf-feature.xml.
inside that javascript I only can call functions. I can not add <script> tag.
As you know map_key of google map is placed inside a <script> tag. how can I add a line like:

  <script src="https://maps.googleapis.com/maps/api/js?key=map_key;callback=initMap"    async defer></script>

inside my javascript file ?
Sincerely.

Best Answer

  • SCRUM_DEVELOPER95
    SCRUM_DEVELOPER95 Member Posts: 55
    edited Dec 24, 2017 1:23PM Accepted Answer

    Eventually I got the answer,
    At first I had to includ my javascript file in the feature content.
    then in my javascript I can get the html elements of the page and (I mean even elements that are inside my outputHtml), there I can handle my intended code

Answers

  • SCRUM_DEVELOPER95
    SCRUM_DEVELOPER95 Member Posts: 55
    edited Dec 24, 2017 1:23PM Accepted Answer

    Eventually I got the answer,
    At first I had to includ my javascript file in the feature content.
    then in my javascript I can get the html elements of the page and (I mean even elements that are inside my outputHtml), there I can handle my intended code