javascript: using the JS object in HTML, when trying to create an HTML loop

CSS is not necessary, since my main focus is the interaction between HTML, JS and external resources.

I implemented a carousel that would be edited to consume more than 100 lines, so I thought about using a JS object to hold the data, then link it to the HTML and display it there.

I have a "simple" HTML file and a JS file that includes the declaration of an object full of currently useless data.

In HTML, I have implemented a carousel using Bootstrap. I gave two HTML examples of what I should show, before trying to use JS to do the same.

The HTML examples worked perfectly. JS's attempts were completely empty.

For some reason, document.write() It doesn't work on StackExchange at all.

I implemented this code on a website called Repl.com, the output and the code can be seen here:
https://repl.it/@00ff0000red/Carousel-JS-Object-Test.
The code can be branched, allowing you to edit it yourself.

var Review =
{
	Number:1,
	Stars:(0,5,1,5),
	Content:("NULL","Quote","Use strict","Quote"),
	Name:
	{
		First:("NULL","FirstName","Java","FirstName"),
		Last:("NULL","LastName","Script","LastName")
	}
}
body
{
	background-color: #242b40;
}

.DefaultText
{
	font-family: "Times New Roman";
	font-size: 20px;
	color: #eee;
	text-align: center;
	/*font-family: "Comic Sans Ms";*/
	text-shadow: 1px 1px 1px #000;
}

#Reviews
{
	background-color: #75a193;
	color: #fff;
}

.Star
{
	color: #FF0;
}




	
		
		
		
		
		
		Proof
	

	

		

Comments:


Comments:

html5: I can't change a style through JavaScript

I was trying to change the color of a word after clicking a button, but I didn't get results.

HTML:



    
        
        My index
        
    
    
        

MENU

CSS: button { position: absolute; top: 10px; left: 10px; height: 50 px; width: 50px; background color: # 2a2e33; color: #ffffff; font weight: bold; edge: transparent; scheme: none; cursor: pointer; Edge: 2px transparent solid; edge radius: 5px; transition: .5s; } #area { position: absolute; background color: # 2a2e33; height: 50 px; width: 50px; left: 10px; top: 10px; edge radius: 5px; transition: .5s; } label { relative position; Type family: Verdana, Geneva, Tahoma, sans-serif; } h1 { relative position; left: 120 px; Type family: Verdana, Geneva, Tahoma, sans-serif; transition: .3s; }

JavaScript:

var botao = document.querySelector('button');
var div = document.querySelector('div');
var menu = document.querySelector('#menu');
botao.style.border = '2px solid transparent';
menu.style.color = '#2a2e33';
menu.style.top = '15px';
botao.onclick = function() {
    div.style.backgroundColor = '#2a2e33';
    div.style.height = '100vh';
    div.style.width = '300px';
    div.style.left = '-10px';
    div.style.top = '-10px';
    setTimeout(cor, 700);
    setTimeout(menu, 500);
};
function cor() {
    botao.style.borderColor = '#ffffff';
};
function menu() {
    menu.style.color = '#ffffff';
    menu.style.top = '5px';
};

I want to change the position and color of the "MENU" after the click. How to proceed?

javascript: Does anyone know if they can design the native Chrome notification API?

Hi, I was asked to use the Chrome native notification API to show a notification to the user as soon as I log in (I know I could use other modes, but they asked me to).

  • This notification is created in JS and makes a request in PHP that returns data from a query.
  • The file I make the query is the puntual-notifications-query.php which appears in the code shown below.

I wonder if it is possible to design this window that opens. I would like, for example, to change the background color, color, font size, etc.

Do you know if this is possible? I searched a lot, but found nothing talking about it.

Below is the code I use to create this notification window:

$(document).ready(function() {
  let chamar = minhaNotificacao();

});

document.addEventListener('DOMContentLoaded', function() {
  if (!Notification) {
    alert("As notificações no desktop não estão disponíveis para o seu navegador. Tente o Chrome");
    return;
  }

  if (Notification.permission !== "granted") {
    Notification.requestPermission();
  }
});

function minhaNotificacao() {
  if (Notification.permission !== "granted") {
    Notification.requestPermission();
  } else {
    $.ajax({
      url: "../banco/notificacoes-pontuais/notificacoes-pontuais-consulta.php",
      data: {
        fonte: 'aocarregar'
      },
      type: "POST",
      async: true

    }).done(function(data) {

        var notification = new Notification('Notificação diária', {
          icon: 'http://cdn.sstatic.net/stackexchange/img/logos/so/so-icon.png',
          body: 'Você possui: nLembretes de eventos para hoje: ' + data.eventos_lembretes + 'nLembretes de Tarefas: ' + data.eventos_tarefas + 'nEventos Vencidos: ' + data.eventos_vencidos,

        });

      }
    }

Next, I show how the notification appears when called:

enter the description of the image here

Thank you

javascript – Magento 2 – Advanced JS package

So, I have been making an advanced js package for my website and have read a lot of information about it. I decided to use m2 development tools to help me do it, however, I have some doubts with the result I obtained. I will not publish all my code here because it is a lot, but I will publish 2/3 packages to see if anyone can help me understand if I am doing things right or wrong.

"modules": (
        {
            // Modules used on > 1 page(s) of the store
            "name": "bundles/shared",
            "include": (
                "jquery",
                "Magento_Theme/js/theme",
                "jquery/jquery-migrate",
                "jquery/patches/jquery",
                "jquery/jquery.mobile.custom",
                "owl.carousel/owl.carousel.min",
                "Smartwave_Megamenu/js/sw_megamenu",
                "jquery-ui-modules/widget",
                "jquery/jquery.cookie",
                "jquery-ui-modules/core",
                "jquery-ui-modules/accordion",
                "domReady",
                "jquery-ui-modules/button",
                "jquery-ui-modules/datepicker",
                "jquery-ui-modules/effect",
                "jquery-ui-modules/effect-blind",
                "jquery-ui-modules/effect-bounce",
                "jquery-ui-modules/effect-clip",
                "jquery-ui-modules/effect-drop",
                "jquery-ui-modules/effect-explode",
                "jquery-ui-modules/effect-fade",
                "jquery-ui-modules/effect-fold",
                "jquery-ui-modules/effect-highlight",
                "jquery-ui-modules/effect-scale",
                "jquery-ui-modules/effect-pulsate",
                "jquery-ui-modules/effect-shake",
                "jquery-ui-modules/effect-slide",
                "jquery-ui-modules/effect-transfer",
                "jquery-ui-modules/mouse",
                "jquery-ui-modules/draggable",
                "jquery-ui-modules/droppable",
                "jquery-ui-modules/position",
                "jquery-ui-modules/menu",
                "jquery-ui-modules/autocomplete",
                "jquery-ui-modules/progressbar",
                "jquery-ui-modules/resizable",
                "jquery-ui-modules/dialog",
                "jquery-ui-modules/selectable",
                "jquery-ui-modules/slider",
                "jquery-ui-modules/sortable",
                "jquery-ui-modules/spinner",
                "jquery-ui-modules/tabs",
                "jquery-ui-modules/timepicker",
                "jquery-ui-modules/tooltip",
                "jquery/compat",
                "underscore",
                "mage/template",
                "mage/smart-keyboard-handler",
                "knockoutjs/knockout",
                "knockoutjs/knockout-es5",
                "mage/ie-class-fixer",
                "js/jquery.stellar.min",
                "matchMedia",
                "js/jquery.lazyload",
                "moment",
                "mage/apply/scripts",
                "mage/apply/main",
                "mage/mage",
                "mage/translate",
                "mage/translate-inline",
                "Magento_Ui/js/lib/knockout/extender/observable_array",
                "jquery/jquery-storageapi",
                "mage/collapsible",
                "mage/tabs",
                "text!ui/template/modal/modal-slide.html",
                "Magento_Ui/js/lib/key-codes",
                "text!ui/template/modal/modal-popup.html",
                "text!ui/template/modal/modal-custom.html",
                "Magento_Ui/js/modal/modal",
                "Magento_Ui/js/modal/confirm",
                "mage/dataPost",
                "jquery/jquery.metadata",
                "jquery/validate",
                "mage/validation",
                "text!js-translation.json",
                "knockoutjs/knockout-repeat",
                "knockoutjs/knockout-fast-foreach",
                "mage/utils/wrapper",
                "es6-collections",
                "Magento_Ui/js/lib/core/events",
                "Magento_Ui/js/lib/knockout/extender/bound-nodes",
                "Magento_Ui/js/lib/knockout/bindings/mage-init",
                "Magento_Ui/js/lib/knockout/bindings/fadeVisible",
                "text!ui/template/tooltip/tooltip.html",
                "Magento_Ui/js/lib/registry/registry",
                "mage/calendar",
                "spectrum",
                "tinycolor",
                "Magento_Ui/js/lib/knockout/template/loader",
                "Magento_Ui/js/lib/knockout/template/renderer",
                "Magento_Ui/js/lib/knockout/bindings/i18n",
                "Magento_Ui/js/lib/knockout/bindings/keyboard",
                "Magento_Ui/js/lib/knockout/bindings/range",
                "Magento_Ui/js/lib/knockout/bindings/after-render",
                "Magento_Ui/js/lib/knockout/bindings/autoselect",
                "Magento_Ui/js/lib/knockout/bindings/outer_click",
                "Magento_Ui/js/lib/knockout/bindings/staticChecked",
                "Magento_Ui/js/lib/knockout/bindings/simple-checked",
                "Magento_Ui/js/lib/knockout/bindings/collapsible",
                "Magento_Ui/js/lib/knockout/bindings/bind-html",
                "Magento_Ui/js/lib/knockout/bindings/tooltip",
                "Magento_Ui/js/lib/knockout/bindings/color-picker",
                "domReady!",
                "Magento_Theme/js/responsive",
                "mage/common",
                "Magento_Ui/js/lib/logger/message-pool",
                "Magento_Ui/js/lib/logger/levels-pool",
                "Magento_Ui/js/lib/logger/logger",
                "Magento_Ui/js/lib/logger/console-output-handler",
                "Magento_Ui/js/lib/logger/logger-utils",
                "Magento_Ui/js/lib/view/utils/bindings",
                "mage/utils/objects",
                "mage/utils/compare",
                "mage/utils/strings",
                "mage/utils/arrays",
                "mage/utils/template",
                "Magento_Ui/js/lib/logger/formatter",
                "FormData",
                "mage/utils/misc",
                "mage/utils/main",
                "Magento_Ui/js/lib/knockout/bindings/optgroup",
                "Magento_Ui/js/lib/knockout/bindings/datepicker",
                "Magento_Ui/js/lib/core/class",
                "Magento_Ui/js/lib/knockout/template/observable_source",
                "Magento_Ui/js/lib/core/storage/local",
                "Magento_Ui/js/lib/logger/entry",
                "Magento_Ui/js/lib/logger/entry-factory",
                "Magento_Ui/js/lib/logger/console-logger",
                "Magento_Ui/js/lib/knockout/template/engine",
                "Magento_Ui/js/lib/knockout/bindings/scope",
                "MutationObserver",
                "Magento_Ui/js/lib/view/utils/dom-observer",
                "Magento_Ui/js/lib/view/utils/async",
                "Magento_Ui/js/lib/knockout/bindings/resizable",
                "Magento_Ui/js/lib/knockout/bindings/bootstrap",
                "Magento_Ui/js/lib/knockout/bootstrap",
                "mage/bootstrap",
                "mage/loader",
                "mage/dropdowns",
                "mage/dropdown",
                "Magento_Search/js/form-mini",
                "Mirasvit_Event/js/capture",
                "mage/validation/validation",
                "mage/cookies",
                "Magento_PageCache/js/page-cache",
                "Magento_Cookie/js/notices",
                "Magento_Ui/js/block-loader",
                "Magento_Customer/js/section-config",
                "Bss_AjaxCart/js/jquery.fancybox",
                "text!ui/template/block-loader.html",
                "Bss_PreOrder/js/catalog-add-to-cart",
                "Magento_Persistent/js/view/customer-data-mixin",
                "Magento_Ui/js/core/renderer/types",
                "Magento_Ui/js/core/renderer/layout",
                "Magento_Ui/js/core/app",
                "Magento_Ui/js/lib/core/element/links",
                "Magento_Ui/js/lib/core/element/element",
                "mage/url",
                "mage/storage",
                "Magento_Customer/js/customer-data",
                "Bss_AjaxCart/js/ajax",
                "Magento_Customer/js/invalidation-processor",
                "Magento_Catalog/js/product/view/product-ids",
                "Magento_Catalog/js/product/view/product-ids-resolver",
                "Magento_Catalog/js/catalog-add-to-cart",
                "Magento_Ui/js/lib/core/collection",
                "Magento_Tax/js/view/checkout/minicart/subtotal/totals",
                "Magento_Msrp/js/view/checkout/minicart/subtotal/totals",
                "Magento_Catalog/js/view/image",
                "Magento_Wishlist/js/view/wishlist",
                "Magento_Customer/js/view/customer",
                "MageWorx_SearchSuiteAutocomplete/js/autocomplete",
                "MageWorx_SearchSuiteAutocomplete/js/bindEvents",
                "MageWorx_SearchSuiteAutocomplete/js/dataProvider",
                "Magento_Theme/js/view/messages",
                "Magento_Customer/js/invalidation-rules/website-rule",
                "mage/decorate",
                "Magento_Catalog/js/view/compare-products",
                "Magento_Customer/js/model/authentication-popup",
                "Magento_Ui/js/modal/alert",
                "Magento_Checkout/js/sidebar",
                "Magento_Checkout/js/view/minicart",
                "MSP_ReCaptcha/js/registry",
                "MSP_ReCaptcha/js/reCaptcha",
                "Magento_Captcha/js/model/captchaList",
                "MSP_ReCaptcha/js/ui-messages-mixin",
                "Magento_Ui/js/lib/spinner",
                "mage/requirejs/resolver",
                "Magento_Catalog/js/product/storage/ids-storage",
                "Magento_Catalog/js/product/storage/ids-storage-compare",
                "Magento_Captcha/js/action/refresh",
                "Magento_Captcha/js/model/captcha",
                "Magento_Captcha/js/view/checkout/defaultCaptcha",
                "Magento_Catalog/js/product/query-builder",
                "Magento_Catalog/js/product/storage/data-storage",
                "Magento_Catalog/js/product/storage/storage-service",
                "Magento_Catalog/js/storage-manager",
                "text!MageWorx_SearchSuiteAutocomplete/template/autocomplete.html",
                "Magento_Ui/js/model/messages",
                "Magento_Ui/js/model/messageList",
                "Magento_Customer/js/action/login",
                "Magento_Captcha/js/view/checkout/loginCaptcha",
                "Magento_Ui/js/view/messages",
                "text!Magento_Checkout/template/minicart/content.html",
                "Magento_Ui/js/form/adapter/buttons",
                "Magento_Ui/js/form/adapter",
                "Magento_Ui/js/form/form",
                "Magento_Customer/js/view/authentication-popup",
                "text!ui/template/collection.html",
                "text!Magento_Customer/template/authentication-popup.html",
                "text!Magento_Ui/template/messages.html",
                "text!MSP_ReCaptcha/template/reCaptcha.html",
                "text!Magento_Captcha/template/checkout/captcha.html",
                "Magento_Cookie/js/require-cookie",
                "Magento_Wishlist/js/add-to-wishlist",
                "Magento_Sales/js/view/last-ordered-items",
                "Magento_Catalog/js/price-utils",
                "text!Magento_Checkout/template/minicart/item/default.html",
                "text!Magento_Catalog/template/product/image_with_borders.html",
                "text!Magento_Checkout/template/minicart/item/price.html",
                "text!Magento_Checkout/template/minicart/subtotal.html",
                "text!Magento_Tax/template/checkout/minicart/subtotal/totals.html",
                "mage/trim-input",
                "Magento_Checkout/js/model/quote",
                "Magento_Tax/js/view/checkout/shipping_method/price",
                "Magento_Checkout/js/model/totals",
                "Magento_Checkout/js/checkout-data",
                "MageWorx_ShippingRules/js/checkout/model/shipping-rates-validation-rules-mixin",
                "Magento_Checkout/js/model/shipping-rates-validation-rules",
                "Magento_Checkout/js/action/select-shipping-method",
                "MageWorx_ShippingRules/js/checkout/model/shipping-rates-validation-rules/general",
                "MageWorx_ShippingRules/js/checkout/model/shipping-rates-validator/general",
                "Magento_Checkout/js/model/step-navigator",
                "Magento_Checkout/js/view/summary/abstract-total",
                "Magento_Tax/js/view/checkout/summary/subtotal",
                "Magento_Tax/js/view/checkout/summary/grand-total",
                "Magento_Weee/js/view/checkout/summary/weee",
                "Magento_SalesRule/js/view/summary/discount",
                "Magento_Tax/js/view/checkout/summary/tax",
                "Magento_Checkout/js/model/shipping-address/form-popup-state",
                "Magento_Checkout/js/action/select-shipping-address",
                "Magento_Checkout/js/model/default-post-code-resolver",
                "Magento_Checkout/js/model/postcode-validator",
                "Magento_Checkout/js/view/summary/shipping",
                "Magento_Tax/js/view/checkout/summary/shipping",
                "Magento_Checkout/js/model/error-processor",
                "Magento_Checkout/js/action/select-billing-address",
                "Magento_Checkout/js/model/new-customer-address",
                "Magento_Checkout/js/model/address-converter",
                "Magento_Checkout/js/action/create-billing-address",
                "Magento_Checkout/js/model/default-validation-rules",
                "Magento_Checkout/js/model/default-validator",
                "Magento_Checkout/js/model/shipping-rates-validator",
                "MageWorx_ShippingRules/js/checkout/view/shipping-rates-validation/general",
                "Magento_Ui/js/lib/validation/utils",
                "Magento_Ui/js/lib/validation/rules",
                "Magento_Ui/js/lib/validation/validator",
                "Magento_Ui/js/form/element/abstract",
                "Magento_Ui/js/form/element/select",
                "Magento_Checkout/js/model/url-builder",
                "Magento_Checkout/js/model/payment/method-list",
                "Magento_Checkout/js/model/full-screen-loader",
                "Magento_Checkout/js/model/shipping-rate-registry",
                "Magento_Customer/js/model/customer/address",
                "Magento_Customer/js/model/customer-addresses",
                "Magento_Customer/js/model/address-list",
                "Magento_Checkout/js/action/create-shipping-address",
                "Magento_Customer/js/model/customer",
                "Magento_Checkout/js/model/resource-url-manager",
                "Magento_Checkout/js/action/get-totals",
                "MagestyApps_FixRules/js/action/select-payment-method",
                "Magento_Checkout/js/model/payment-service",
                "Magento_Checkout/js/model/checkout-data-resolver",
                "Magento_Checkout/js/model/shipping-service",
                "text!Magento_Tax/template/checkout/summary/subtotal.html",
                "text!ui/template/form/element/select.html",
                "text!Magento_Tax/template/checkout/shipping_method/price.html"
            ),
            "exclude": (),
            "create": true
        },
        {
            "name": "bundles/customer-account-index",
            "create": true,
            "include": (
                "mage/toggle"
            ),
            "exclude": (
                "bundles/shared"
            )
        },
        {
            "name": "bundles/checkout-index-index",
            "create": true,
            "include": (
                "Magento_Checkout/js/checkout-loader",
                "Magento_Checkout/js/view/summary/item/details/thumbnail",
                "Mageplaza_Osc/js/view/review/addition",
                "Magento_Checkout/js/view/summary/item/details/message",
                "text!Mageplaza_Osc/template/3columns-colspan.html",
                "Magento_Checkout/js/model/payment/renderer-list",
                "Magento_OfflinePayments/js/view/payment/offline-payments",
                "Ifthenpay_Multibanco/js/view/payment/multibanco-payments",
                "Magento_Paypal/js/view/payment/paypal-payments",
                "Magento_Checkout/js/model/payment/additional-validators",
                "Mageplaza_Osc/js/model/payment-service",
                "Mageplaza_Osc/js/model/paypal_express_compatible",
                "Mageplaza_Osc/js/model/osc-data",
                "Mageplaza_Osc/js/view/review/comment",
                "Mageplaza_Osc/js/model/compatible/amazon-pay",
                "Mageplaza_Osc/js/model/checkout-data-resolver",
                "Magento_Shipping/js/model/config",
                "Magento_Shipping/js/view/checkout/shipping/shipping-policy",
                "Magento_Ui/js/form/components/group",
                "Magento_Checkout/js/view/summary",
                "Magento_Checkout/js/view/summary/cart-items",
                "Magento_Checkout/js/view/summary/totals",
                "Magento_Checkout/js/view/summary/item/details/subtotal",
                "Magento_Tax/js/view/checkout/summary/item/details/subtotal",
                "Magento_Weee/js/view/checkout/summary/item/price/weee",
                "Magento_Weee/js/view/checkout/summary/item/price/row_incl_tax",
                "Magento_Weee/js/view/checkout/summary/item/price/row_excl_tax",
                "Magento_Checkout/js/view/summary/item/details",
                "Mageplaza_Osc/js/model/braintree-paypal",
                "Magento_Checkout/js/model/payment/method-converter",
                "Magento_Checkout/js/model/sidebar",
                "Magento_Checkout/js/view/sidebar",
                "Mageplaza_Osc/js/model/gift-message",
                "Magento_Customer/js/action/check-email-availability",
                "Magento_Checkout/js/view/shipping-address/list",
                "Mageplaza_Osc/js/view/geoip",
                "Magento_Checkout/js/model/customer-email-validator",
                "Magento_Checkout/js/view/payment/email-validator",
                "Magento_Checkout/js/view/form/element/email",
                "Mageplaza_Osc/js/model/resource-url-manager",
                "Mageplaza_Osc/js/action/check-email-availability",
                "Mageplaza_Osc/js/view/form/element/email",
                "Mageplaza_Osc/js/action/gift-message-item",
                "text!Mageplaza_Osc/template/container/sidebar.html",
                "Mageplaza_Osc/js/model/address/type/google",
                "Mageplaza_Osc/js/model/address/auto-complete",
                "Mageplaza_DeliveryTime/js/model/delivery-information",
                "Mageplaza_DeliveryTime/js/action/set-shipping-information-mixin",
                "Magento_Checkout/js/view/estimation",
                "Magento_Checkout/js/action/get-payment-information",
                "Mageplaza_Osc/js/model/shipping-save-processor/checkout",
                "Magento_Ui/js/form/element/post-code",
                "text!Mageplaza_Osc/template/container/summary.html",
                "text!Mageplaza_Osc/template/container/review/addition.html",
                "Magento_Checkout/js/view/payment",
                "Mageplaza_Osc/js/view/payment",
                "Magento_Checkout/js/view/payment/list",
                "Mageplaza_Osc/js/view/payment/list",
                "Mageplaza_Osc/js/model/osc-loader",
                "Mageplaza_Osc/js/action/update-item",
                "Mageplaza_Osc/js/view/summary/item/details",
                "Mageplaza_Osc/js/action/payment-total-information",
                "Mageplaza_Osc/js/model/shipping-rate-processor/new-address-mixin",
                "Mageplaza_Osc/js/model/shipping-rate-processor/customer-address-mixin",
                "Mageplaza_Osc/js/model/shipping-rate-service",
                "Magento_Checkout/js/model/shipping-save-processor/payload-extender",
                "Magento_Checkout/js/model/shipping-save-processor/default",
                "Magento_Checkout/js/model/shipping-save-processor",
                "Mageplaza_Osc/js/action/set-checkout-information",
                "Mageplaza_Osc/js/view/review/placeOrder",
                "Magento_Checkout/js/action/set-shipping-information",
                "Mageplaza_Osc/js/model/shipping-rates-validator",
                "Magento_Checkout/js/view/shipping",
                "Mageplaza_Osc/js/view/shipping",
                "text!Magento_Checkout/template/summary/totals.html",
                "text!Mageplaza_Osc/template/container/summary/cart-items.html",
                "text!Magento_Checkout/template/estimation.html",
                "text!Mageplaza_Osc/template/container/payment.html",
                "text!Mageplaza_Osc/template/payment-methods/list.html",
                "text!Magento_Tax/template/checkout/summary/shipping.html",
                "Magento_Checkout/js/model/payment/method-group",
                "Magento_Checkout/js/view/shipping-address/address-renderer/default",
                "Mageplaza_Osc/js/view/shipping-address/address-renderer/default",
                "text!Magento_Tax/template/checkout/summary/tax.html",
                "text!Magento_Tax/template/checkout/summary/grand-total.html",
                "text!Mageplaza_Osc/template/checkout/summary/weee.html",
                "text!Mageplaza_Osc/template/container/summary/item/details.html",
                "text!Magento_Checkout/template/payment-methods/list.html",
                "text!Mageplaza_Osc/template/container/shipping.html",
                "text!Mageplaza_Osc/template/container/review/place-order.html",
                "text!Mageplaza_Osc/template/container/address/shipping-address.html",
                "text!Magento_SalesRule/template/summary/discount.html",
                "text!Magento_Checkout/template/summary/item/details/thumbnail.html",
                "text!Magento_Tax/template/checkout/summary/item/details/subtotal.html",
                "text!Magento_Shipping/template/checkout/shipping/shipping-policy.html",
                "text!Mageplaza_Osc/template/container/address/shipping/form.html",
                "text!Magento_Checkout/template/shipping-address/list.html",
                "text!Mageplaza_Osc/template/container/review/comment.html",
                "text!Mageplaza_Osc/template/container/form/element/email.html",
                "Magento_Checkout/js/action/set-billing-address",
                "text!Magento_Weee/template/checkout/summary/item/price/row_excl_tax.html",
                "text!ui/template/group/group.html",
                "text!Mageplaza_Osc/template/container/form/field.html",
                "text!Mageplaza_Osc/template/container/address/shipping/address-renderer/default.html",
                "Magento_Checkout/js/model/billing-address-postcode-validator",
                "Magento_Checkout/js/view/billing-address",
                "Mageplaza_Osc/js/view/billing-address",
                "text!Mageplaza_Osc/template/container/form/element/input.html",
                "text!ui/template/form/element/helper/tooltip.html",
                "Magento_Checkout/js/action/redirect-on-success",
                "Mageplaza_Osc/js/action/place-order-mixins",
                "text!Mageplaza_Osc/template/container/address/billing-address.html",
                "text!Mageplaza_Osc/template/container/address/billing/checkbox.html",
                "Magento_Checkout/js/model/place-order",
                "Magento_Checkout/js/action/place-order",
                "Mageplaza_Osc/js/model/agreements-assigner",
                "Magento_CheckoutAgreements/js/model/place-order-mixin",
                "Magento_Checkout/js/view/payment/default",
                "Magento_OfflinePayments/js/view/payment/method-renderer/banktransfer-method",
                "Magento_OfflinePayments/js/view/payment/method-renderer/cashondelivery-method",
                "Magento_OfflinePayments/js/view/payment/method-renderer/checkmo-method",
                "text!Magento_Checkout/template/billing-address/list.html",
                "text!Magento_OfflinePayments/template/payment/banktransfer.html",
                "text!Magento_OfflinePayments/template/payment/cashondelivery.html",
                "text!Magento_OfflinePayments/template/payment/checkmo.html",
                "text!Magento_Checkout/template/payment/before-place-order.html"
            ),
            "exclude": (
                "bundles/shared"
            )
        }

"packages / client-index-index", What is hapening here? The m2 development tools tell me that I should include "mage / toggle" and exclude "bundles / shared". From what I understand, will it only include 1 dependency? All my packages exclude only "packages / shares", is that supposed to be so? Shouldn't you also exclude the other packages? Or should I not exclude other packages and include "packages / shares", since it is "shared"?

html: Javascript function is only activated after clicking on the second button

This is because when you click the first time you call the function removerEstado() and call the click function, in the second the function has already been called and the click function can be used

The right thing would be to do the following.

$('#btn-remover-estado').click(function(){
    let estados = document.getElementById('lista-estados');
    estados.remove(estados.selectedIndex);
});

OR

function removerEstado(){
    let estados = document.getElementById('lista-estados');
    estados.remove(estados.selectedIndex);
}

javascript – How to display jquery popup only on one page?

I have this jquery popup window but I need to show it only on the home page. Here is the code:

$(document).ready(function(){

$ ("# thover"). click (function () {
$ (this) .fadeOut ();
$ ("# tpopup"). fadeOut ();
});

$ ("# tclose"). click (function () {
$ ("# thover"). fadeOut ();
$ ("# tpopup"). fadeOut ();
});

});

Thanks in advance.

javascript: problem trying to add ckeditor elements

I have a page that loads a modal bootstrap.
Inside Modal there is a text area with ckeditor.
The problem when I try to add a table, for example, I click on the Add table icon, it opens the dialog window but I cannot click on the entries only in the selections

Here I call ckeditor

    

According to the image there, I can't click on the entries to edit, just the selections, what can it be?

According to the image there, I can't click on the entries to edit, just the selections, what can it be?

jquery – JavaScript runs one click at a time

I have a problem when I click on the button, activate the function the number of times it is clicked. When I click 3x in a row, the same 3x function is activated causing slowness. How do I solve it, code:

button id = "Search"

callSearch () function {
$ (& # 39; # Search & # 39;). One (& # 39; click & # 39 ;, function (e) {
doSearch ()
callSearch ()
})
}

My intention is after finishing doSearch, I want to release the click to perform a new search, but not more than one doSearch at a time.

javascript: invalid "�" character when using Hummus (PDF) for JS node

I am trying to use Hummus on the JS Node to open the pdf, replace the string and save a new pdf.
The problem is when I save a new pdf. It does not save characters like "ã", "õ", "ê" (UTF-8).

Can anybody help me?

My code (taken from here):

const hummus = require('hummus');
const fs = require('fs');

/**
 * Returns a byteArray string
 * 
 * @param {string} str - input string
 */
function strToByteArray(str) {
var utf8 = ();
    for (var i=0; i < str.length; i++) {
        var charcode = str.charCodeAt(i);
        if (charcode < 0x80) utf8.push(charcode);
        else if (charcode < 0x800) {
            utf8.push(0xc0 | (charcode >> 6), 
                      0x80 | (charcode & 0x3f));
        }
        else if (charcode < 0xd800 || charcode >= 0xe000) {
            utf8.push(0xe0 | (charcode >> 12), 
                      0x80 | ((charcode>>6) & 0x3f), 
                      0x80 | (charcode & 0x3f));
        }
        // surrogate pair
        else {
            i++;
            // UTF-16 encodes 0x10000-0x10FFFF by
            // subtracting 0x10000 and splitting the
            // 20 bits of 0x0-0xFFFFF into two halves
            charcode = 0x10000 + (((charcode & 0x3ff)<<10)
                      | (str.charCodeAt(i) & 0x3ff));
            utf8.push(0xf0 | (charcode >>18), 
                      0x80 | ((charcode>>12) & 0x3f), 
                      0x80 | ((charcode>>6) & 0x3f), 
                      0x80 | (charcode & 0x3f));
        }
    }
    return utf8;
}

function replaceText(sourceFile, targetFile, pageNumber, findText, replaceText) {  
    var writer = hummus.createWriterToModify(sourceFile, {
        modifiedFilePath: targetFile
    });
    var modifier = new hummus.PDFPageModifier(writer, pageNumber);
    var sourceParser = writer.createPDFCopyingContextForModifiedFile().getSourceDocumentParser();
    var pageObject = sourceParser.parsePage(pageNumber);
    var textObjectId = pageObject.getDictionary().toJSObject().Contents.getObjectID();
    var textStream = sourceParser.queryDictionaryObject(pageObject.getDictionary(), 'Contents');
    //read the original block of text data
    var data = ();
    var readStream = sourceParser.startReadingFromStream(textStream);
    while(readStream.notEnded()){
        Array.prototype.push.apply(data, readStream.read(10000));
    }
    var string = new Buffer(data).toString().replace(findText, replaceText);

    //Create and write our new text object
    var objectsContext = writer.getObjectsContext();
    objectsContext.startModifiedIndirectObject(textObjectId);

    var stream = objectsContext.startUnfilteredPDFStream();
    stream.getWriteStream().write(strToByteArray(string));
    objectsContext.endPDFStream(stream);

    objectsContext.endIndirectObject();

    writer.end();
}

replaceText('file.pdf', 'output.pdf', 0, /REPLACEME/g, 'My New Custom Text');

Sorry for my bad English.

javascript: CORS error in the request with axes

Well guys, I have a problem making a request with axes of the Riot games API. The response returns code 200, which is the code when the request worked, but I cannot handle the object returned by json due to an error that is occurring.
NOTE: I am a little beginner in JS

Code:
let axios = require (& # 39; axios & # 39;)

axios.get (& # 39; https: //en1.api.riotgames.com/lol/summoner/v4/summoners/by-name/user? api_key = myApiKey & # 39;)
.then (answer => document.write (answer.name))
.catch (error => console.log (error))

Error that appears