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 8425991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:25:36+00:00 2026-06-10T04:25:36+00:00

I have very simple html and js files – which I’ve included below. What

  • 0

I have very simple html and js files – which I’ve included below.

What is interesting (and frustrating) is that these files work in Safari – but in Firefox, pressing the Submit button generates this error message:

Error: sFeedback is not defined

Source File: javascript:sFeedback(); Line: 1

Reading other postings like JavaScript function not defined in Firefox?, it seems that Firefox may need to have function defined before it can be called. If this is the case, is there a way – in my setup – to have function defined prior to call?

quiz.html:

<!DOCTYPE html>
<html>
<head>
    <title>Math Quiz</title>
    <meta name="generator" content="BBEdit 9.6" />
</head>
<script language="JavaScript" src="generateQuizItem.js">
</script>

<body onLoad="javascript:sGenerateQuizItem();">


</body>
</html>

And javascript:

var a0;
var a1;
var sum;
        
function sFeedback()
    {
    var answer = document.quiz_form.answer.value;
    document.write("answer = " + answer + "<br>");
    if (answer == sum)
        document.write("Right!<br>");
    else
        document.write("Wrong!<br>");
    }
    
function sGenerateQuizItem()
    {
    a0 = 20;
    a1 = 40;
    sum = a0 + a1;
    
    document.write("<form action=\"javascript:sFeedback();\" method=\"get\" name=\"quiz_form\">\n");
    document.write(a0 + " + " + a1 + " = ");
    document.write("<input name=\"answer\" id=\"answer\" type=\"text\" size=\"4\" maxlength=\"4\" /><br><br>\n");
    document.write("<button type=\"submit\" id=\"submit\">Submit</button>");
    document.write("</form>");
    }
  • 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-10T04:25:38+00:00Added an answer on June 10, 2026 at 4:25 am

    Try putting the script reference within the head of your document.

    <!DOCTYPE html>
    <html>
    <head>
        <title>Math Quiz</title>
        <script src="generateQuizItem.js"></script>
    </head>
    <body onLoad="sGenerateQuizItem();">
    
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple HTML/JS code, which expands the size of a div
I have this html page which is very simple, it contains a text box
A very simple question. I have a html page which is divided into three
I have a very simple pure html file in which I have many PDF
Suppose I have a bunch of (very simple) HTML pages, that I want to
I have this very simple CODE, which should generate me HTML, but all I
I have a very simple html page with the following javascript in it $(function()
So I have 4 pages. They are very simple. index.php (WORKS) <html> <form action=upload.php
I have a very simple table called Member , which consists of the following:
I have a very simple test page that uses XHR requests with jQuery's $.getJSON

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.