Export/ Import Vanilla JS - import

I have a website, that consists of 4 html pages, which is the best option:
should I connect all of these htmls to 1 js file or I should connect them to different JS, in total 4 html = 4 js and should I export/import information?

Related

Magento 2 Admin Pages Content

I'm new to Magento 2 development and am trying to customize some of the content on admin pages and on the "customer account" pages.
Can anyone tell me where the PHP/html code for these is located in the standard file structure? Are there any codeblocks/layouts used for these?
Magento admin pages are mostly built from ui_component ( form, listing ) which requires to understand not only html or phtml , but also knockout js, smarty template , xml and data provider. So nobody can help you with some lines of code or just show you the files you need.

Integrate GTM snippets with AEM pages

Is there any direct way to integrate Google Tag Manager JS snippets in AEM pages ?
The AEM Tools provide only for Google Analytics snippet using cloud services component. But GTM needs two code snippets on a page, one in <head> and one in <body> section of the page.
Hard coding the JS snippets in my HTML's is not a good idea.
GTM scripts is based on website specific tracking. So you can create sitelevel configurations for GTM containerID(think for future) and add header footer script in page component with dynamic containerID that you can configure in site level config so that it will be available across all pages.

Is there a way through which I can embed external HTML page as a component at run time in ionic 3

We know that we can use pages or components in ionic. These pages and components contain .html files, which have html markup. When we build the app, all these files are bundled into the app.
My question is whether we can use or embed external .html files and act on that .html file.
For example: if we have a login page which contains username and password fields and submit button. We have already defined css for this page. There is a requirement for my project to embed external .html file and use it as login page. It may have a different css.
if you mean that you have html tags in JSON response for example and you want to add them to ionic just do :
<div [innerHTML]="your-JSON-response-Html"></div>

How to post form using angular js 4

I am creating single page application with angular js 4.
How can I post form on submit button click using angular js 4.
Thank you.
Simply get your form value using this and post to the database or wherever you want.
this.formName.value
for more detail see demo example by angular
https://embed.plnkr.co/?show=preview

How to compress the CSS and JS in Moodle

The moodle site takes 12 seconds to load the login page, if 10 concurrent users access the site.
Is there any possibility to compress the CSS and Java script through Moodle admin end?
You could minify your CSS (cssminifier.com/)
And JS (http://jscompress.com/)
I dont think there is anything native to Moodle to do this.