Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8793187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:05:28+00:00 2026-06-13T23:05:28+00:00

Please keep in mind that I am VERY new to all of this javascript/node.js

  • 0

Please keep in mind that I am VERY new to all of this javascript/node.js style of HTML coding. In the past, all I have ever done with HTML is static/information style pages.

I am trying to create an HTML webpage that will take xmpp related information from a user (server address, port, user JID, password, chat messages, other user JID, etc.) and route it through the node.js server to the xmpp server. Ultimately, what I am trying to do is take the webrtc.io code and extend it to be tied to and interact with users on an XMPP server. In trying to do this, I found the node-xmpp module and “installed” it (npm install) to the node_modules folder within my project working directory.

I then created a very basic index.html file (text input boxes) that takes user information and then calls functions within a javascript file that is included in the index.html file. Within the javascript file, I added the require function/call const xmpp = require('node-xmpp'), added the var client = new xmpp.Client({[connection settings]}); and then started with some basic stanza handler and other xmpp functions.

When I then “run” the code in the browser, before I even start entering in information, I see that the console is reporting errors. At first they were errors with the xmpp functions I wrote, so I commented everything out to just have the new xmpp.Client({}) line just to see if it would even connect. But then, I would get an error with the cont xmpp = require('node-xmpp'). That error is

Uncaught ReferenceError: require is not defined (anonymous function)

From my limited understanding of all of this html/javascript/server stuff, I think what is happening is that the client/browser does not know/have access to either the node.js or node-xmpp library.

Is this right? Should I be doing things differently? And are there any good tutorials/documentation out there that covers this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:05:29+00:00Added an answer on June 13, 2026 at 11:05 pm

    If I’m understanding what you’re saying, you’re trying to execute the node code within the browser. Node source should be executed on the server, not in the browser. You’ll have two sets of JavaScript files: Those you serve to the browser to be executed on the browser and those that are executed on the server using a node instance. If I misunderstood, please tell us a little bit more about the structure of your system.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Keep in mind that I am still very new to python coding as I
Okay, so I'm very new to website design, so please keep that in mind.
I am new to programming in general so please keep that in mind when
Please keep in mind that I am new to world of .Net and F#.
Please keep in mind that I'm a really newbie Cocoa developer Scenario: I've a
To keep things simple, please allow the assumption that some code requires the use
Please bear with me as I am new to dojo, javascript, and web programming
I have a VERY simple C# Winforms project that I made using Visual Studio
Let us say I have a table called animals that looks like this: 1
Even before telling my question, will tell you that this is a very vague

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.