Javascript module not found when its obviously loaded [on hold]

141
November 08, 2018, at 5:30 PM

I am using the CurrencyHandler module in a select menu on the current page and I am trying to use it on button click also. It works on the mentioned above select menu. But on the button on click event it throws me an error:

Uncaught ReferenceError: CurrencyHandler is not defined

My module looks like:

let currencyHandler = (() => {
    .....
    some methods
    .....
    let validateForm = () => {
        alert(1231)
    }
    return {
        ....,
        validateForm: validateForm
    }
})()

The button looks like (It's Yii2 framework code):

echo Html::button(Yii::t('app', 'app.add'),
                        [
                            'class' => 'btn btn-info',
                            'id' => 'showOrderPrice',
                            'data' => [
                                'toggle' => 'modal',
                                'target' => '#myModal'
                            ],
                            'onclick' => 'CurrencyHandler.validateForm()'
                        ]);

I am very familiar with javascript so I might be mistaking with the module declaration. What can cause my problem ?

Answer 1

It looks like you have a typo? currencyHandler should have a capital C?

Rent Charter Buses Company
READ ALSO
How to handle concurrent request sequentially in golang?

How to handle concurrent request sequentially in golang?

I'm new to Golang and I found go channels very interestingMy background is from JavaScript and I want to handle concurrent request sequentially in Go, sort of like Promise

234
How to read FormData in Microsoft Edge after appending value to it

How to read FormData in Microsoft Edge after appending value to it

In the code given below i am able to append data in MS Edge but when it comes to reading that value i don't have any option given my MicrosoftIs there any workaround to read already appended values ? Any help would be appreciated

378
How to read the Chrome chronology from file “history”

How to read the Chrome chronology from file “history”

the SQLite history file is stored in C:

157
How to change value appcss in laravel

How to change value appcss in laravel

I want to change background color in laravel pageBased on reference that i get

195