Click here to Skip to main content
15,351,281 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Proper decoding using Vanilla Javascript Pin
Richard Deeming24-Feb-22 0:21
mveRichard Deeming24-Feb-22 0:21 
GeneralRe: Proper decoding using Vanilla Javascript Pin
jkirkerx24-Feb-22 5:37
professionaljkirkerx24-Feb-22 5:37 
QuestionAngular JS A href in View source Pin
Member 367124116-Feb-22 1:36
MemberMember 367124116-Feb-22 1:36 
AnswerRe: Angular JS A href in View source Pin
Richard Deeming17-Feb-22 1:58
mveRichard Deeming17-Feb-22 1:58 
QuestionWhy is my last input box not centering (class: powerwall-battery-input)? Pin
WannaBeAWebDev11-Feb-22 14:20
MemberWannaBeAWebDev11-Feb-22 14:20 
AnswerRe: Why is my last input box not centering (class: powerwall-battery-input)? Pin
rnbergren15-Feb-22 3:03
Memberrnbergren15-Feb-22 3:03 
QuestionUsing modules in a regular PHP Web Application - function is undefined Pin
jkirkerx9-Feb-22 12:23
professionaljkirkerx9-Feb-22 12:23 
AnswerRe: Using modules in a regular PHP Web Application - function is undefined - Think I got it now Pin
jkirkerx9-Feb-22 13:25
professionaljkirkerx9-Feb-22 13:25 
Wow ....

So all my modules were created, imported and stored on the module level above the DOM. I had to get these modules down to the DOM level to be defined and consumed. But if I write individual window statements, I will run into global pollution? So you put them all in a window namespace?

It works now, so far so good, and is exactly what I wanted to achieve with having a unified core module to call throughout the core of my PHP project. This is quite promising so far, hope it works out. Started to lose version control of all the scripts in my project, and now I've eliminated duplicate script functions.
onclick="core.saveProjectWithProgress()"

// Target imports these specific functions only
import { dismissProjectNoticesAsync as dismissProjectNotices } from './projectNoticesModal.module.js';
import { saveVersionNoteAsync as saveVersionNote } from './saveVersionNote.module.js';
import { saveManagerAsync as saveManager } from './saveManagerAsync.module.js';
import { saveSwanJobAsync as saveSwanJob } from './saveSwanJobAsync.module.js';
import { saveCommentAsync as saveComment } from './saveCommentsAsync.module.js';
import { removeCommentAsync as removeComment } from './removeComment.module.js';
import { addFeatureAsync as addFeature, removeFeatureAsync as removeFeature, validateFeatureAsync as validateFeature } from './features.module.js';
import { checkSupplierAsync as checkSupplier } from './checkSupplierAsync.module.js';
import { recalculateAsync as recalculate } from './recalculateProjectAsync.module.js';
import { saveProjectAsync as saveProject } from './saveProjectAsync.module.js';
import { saveProjectWithProgressAsync as saveProjectWithProgress } from './saveProjectWithProgress.module.js';

// Export these function from the module to DOM level
window.core = {

    dismissProjectNotices,
    saveVersionNote,
    saveManager,
    saveSwanJob,
    saveComment,
    removeComment,
    addFeature,
    removeFeature,
    validateFeature,
    checkSupplier,
    recalculate,
    saveProject,
    saveProjectWithProgress
}
If it ain't broke don't fix it
Discover my world at jkirkerx.com

AnswerRe: Using modules in a regular PHP Web Application - function is undefined Pin
Richard Deeming9-Feb-22 21:49
mveRichard Deeming9-Feb-22 21:49 
GeneralRe: Using modules in a regular PHP Web Application - function is undefined Pin
jkirkerx10-Feb-22 5:00
professionaljkirkerx10-Feb-22 5:00 
GeneralRe: Using modules in a regular PHP Web Application - function is undefined Pin
jkirkerx10-Feb-22 10:52
professionaljkirkerx10-Feb-22 10:52 
QuestionModules and scripts, common modules and scripts, just want to call some functions from a common external script, sort of ES6 Pin
jkirkerx28-Jan-22 10:29
professionaljkirkerx28-Jan-22 10:29 
AnswerRe: Modules and scripts, common modules and scripts, just want to call some functions from a common external script, sort of ES6 Pin
jkirkerx28-Jan-22 10:52
professionaljkirkerx28-Jan-22 10:52 
QuestionArea of ​​a 2d room Pin
Member 1550401118-Jan-22 1:29
MemberMember 1550401118-Jan-22 1:29 
SuggestionRe: Area of ​​a 2d room Pin
Richard MacCutchan18-Jan-22 1:37
mveRichard MacCutchan18-Jan-22 1:37 
QuestionHow to solve this in js Pin
Miraz Uddin17-Jan-22 18:57
MemberMiraz Uddin17-Jan-22 18:57 
AnswerRe: How to solve this in js Pin
Richard Deeming17-Jan-22 21:34
mveRichard Deeming17-Jan-22 21:34 
QuestionHow to solve this in js Pin
Miraz Uddin17-Jan-22 18:53
MemberMiraz Uddin17-Jan-22 18:53 
AnswerRe: How to solve this in js Pin
Richard Deeming17-Jan-22 21:34
mveRichard Deeming17-Jan-22 21:34 
GeneralString Pin
SHAFI CANVASS6-Jan-22 12:40
MemberSHAFI CANVASS6-Jan-22 12:40 
GeneralRe: String Pin
RedDk6-Jan-22 13:07
MemberRedDk6-Jan-22 13:07 
GeneralRe: String Pin
jhonaa11-Jan-22 21:24
Memberjhonaa11-Jan-22 21:24 
QuestionReplecing .data() jQuery with JavaScript Pin
Member 154605438-Dec-21 9:46
MemberMember 154605438-Dec-21 9:46 
AnswerRe: Replecing .data() jQuery with JavaScript Pin
Richard Deeming8-Dec-21 22:12
mveRichard Deeming8-Dec-21 22:12 
QuestionCan't figure out why I'm not able to access my projects array within my JSON object Pin
jkirkerx23-Nov-21 13:20
professionaljkirkerx23-Nov-21 13:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.