Click here to Skip to main content
15,881,380 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: [Learning/Beginner] Confused about await, async and fetch. Pin
Maximilien3-May-23 12:56
Maximilien3-May-23 12:56 
GeneralRe: [Learning/Beginner] Confused about await, async and fetch. Pin
Jeremy Falcon4-May-23 4:47
professionalJeremy Falcon4-May-23 4:47 
QuestionAxios Pin
darlina1-May-23 22:47
darlina1-May-23 22:47 
Questionjson and json-server with weird be valid json file. Pin
Maximilien21-Apr-23 2:17
Maximilien21-Apr-23 2:17 
AnswerRe: json and json-server with weird be valid json file. Pin
Richard Deeming21-Apr-23 2:32
mveRichard Deeming21-Apr-23 2:32 
GeneralRe: json and json-server with weird be valid json file. Pin
Maximilien21-Apr-23 4:15
Maximilien21-Apr-23 4:15 
GeneralRe: json and json-server with weird be valid json file. Pin
Richard Deeming21-Apr-23 5:37
mveRichard Deeming21-Apr-23 5:37 
QuestionApplication is "dead" when I open it in a browser Pin
arnold_w16-Mar-23 23:23
arnold_w16-Mar-23 23:23 
My colleague, who is on vacation, wrote a Javascript application that I need to port to C#. I know nothing about Javascript so at this point I'm happy if I'm just able to execute it successfully. There is a file called "index.html" and when I open this in Chrome I can see buttons, textboxes, comboboxes, etc but everything is "dead" , nothing happens when I e.g. click a button. Does anybody know how I can bring the application to life? Also, does anybody know if there exist a free IDE where I can edit the source code (it would be a bonus if I can step the code as well)?

Updated information: I installed "Visual Studio Code" and opened the project folder there and when I click "Start Debugging" I see the GUI flashing by quickly and then nothing happens. In the "Terminal" window I see the following:
"npm run start
Debugger attached.

> firmwareprogrammer@1.0.0 start
> electron .

Debugger attached.

Main process started
Waiting for the debugger to disconnect...
Waiting for the debugger to disconnect..."

Updated information again: I'm now able to step the code in "Visual Studio Code" and when the following function is executed, the GUI-windows are showing (but they are all white), but as soon as the function is finished executing the GUI-windows disappear:
JavaScript
function createWindow () {
  mainWin = new BrowserWindow({
    width: 1100,
    height: 870,
    minWidth: 1100,
    maxWidth: 1100,
    minHeight: 870,
    maxHeight: 870,
    webPreferences: {
      nodeIntegration: true,
      contextIsolation: false,
      enableRemoteModule: true,
//      preload: path.join(__dirname, "preload.js")
    }
  })

//  mainWin.removeMenu();
//  win.loadFile('index.html')
//require("@electron/remote/main").enable(win.webContents);
//mainWin.webContents.openDevTools()
devtools = new BrowserWindow();
mainWin.webContents.setDevToolsWebContents(devtools.webContents)
mainWin.webContents.openDevTools({ mode: 'detach' })
  
mainWin.loadURL(url.format({
      pathname: path.join(__dirname, 'index.html'),
      protocol: 'file',
      slashes: true
  }))
  mainWin.webContents.openDevTools()
  mainWin.on('close', () => {
    mainWin = null;
  })
}


modified 17-Mar-23 9:07am.

AnswerRe: Application is "dead" when I open it in a browser Pin
jschell5-Apr-23 6:30
jschell5-Apr-23 6:30 
QuestionJavascript Form Validation - Help needed Pin
Kobraz11-Mar-23 12:43
Kobraz11-Mar-23 12:43 
QuestionJavaScript Pin
Member 159403612-Mar-23 17:42
Member 159403612-Mar-23 17:42 
RantRe: JavaScript Pin
Richard Deeming2-Mar-23 21:24
mveRichard Deeming2-Mar-23 21:24 
JokeRe: JavaScript Pin
Jeremy Falcon8-Mar-23 12:57
professionalJeremy Falcon8-Mar-23 12:57 
SuggestionJavaScript Pin
Member 159403612-Mar-23 17:40
Member 159403612-Mar-23 17:40 
RantRe: JavaScript Pin
Richard Deeming2-Mar-23 21:24
mveRichard Deeming2-Mar-23 21:24 
GeneralRe: JavaScript Pin
jschell10-Mar-23 11:07
jschell10-Mar-23 11:07 
QuestionDisable a textbox inside Repeater control when any of the DropDownList values also inside Repeater, is selected Pin
Ihechi Alozie2-Mar-23 12:17
Ihechi Alozie2-Mar-23 12:17 
AnswerRe: Disable a textbox inside Repeater control when any of the DropDownList values also inside Repeater, is selected Pin
Richard Deeming2-Mar-23 21:27
mveRichard Deeming2-Mar-23 21:27 
QuestionHow to replace the select of my html Pin
sanphil2-Mar-23 1:07
sanphil2-Mar-23 1:07 
QuestionHow to display a pop up without click and without login Pin
Member 1593182922-Feb-23 6:20
Member 1593182922-Feb-23 6:20 
AnswerRe: How to display a pop up without click and without login Pin
Jeremy Falcon27-Feb-23 7:29
professionalJeremy Falcon27-Feb-23 7:29 
QuestionHow to show or hide a div with only class without ID Pin
flexi220220-Feb-23 6:36
flexi220220-Feb-23 6:36 
AnswerRe: How to show or hide a div with only class without ID Pin
Richard Deeming20-Feb-23 21:54
mveRichard Deeming20-Feb-23 21:54 
GeneralRe: How to show or hide a div with only class without ID Pin
flexi220221-Feb-23 0:03
flexi220221-Feb-23 0:03 
GeneralRe: How to show or hide a div with only class without ID Pin
Richard Deeming21-Feb-23 1:43
mveRichard Deeming21-Feb-23 1:43 

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.