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

  • Home
  • SEARCH
  • 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 8521559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:51:45+00:00 2026-06-11T06:51:45+00:00

A php include (a form submission) prints this when the form inputs were valid.

  • 0

A php include (a form submission) prints this when the form inputs were valid.

if ( $valid ) {
    echo "<script type='text/javascript'>
    $(document).ready(function() {
        console.log('success');
        notificationOutput('success', 'Successfully subscribed');
    });
    </script>";

In my header.php I’m including jQuery.

However when doing the thing above my console tells me that it doesn’t know $. It doesn’t make a difference if I write jQuery(document).ready(…

What do I miss here? As said above the echo is inside an included file so the header with all its scripts is already on the page.

Thank you in advance.

  • 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-11T06:51:46+00:00Added an answer on June 11, 2026 at 6:51 am

    This isnt my answer i just copied it in here JQuery – $ is not defined

    credit goes to @Mike Trpcic

    That error can only be caused by one of three things:

    Your JavaScript file is not being properly loaded into your page
    You have a botched version of jQuery. This could happen because someone edited the core file, or a plugin may have overwritten the $ variable.
    You have JavaScript running before the page is fully loaded, and as such, before jQuery is fully loaded.
    You should check the Firebug net panel to see if the file is actually being loaded properly. If not, it will be highlighted red and will say “404” beside it. If the file is loading properly, that means that the issue is number 2.

    Make sure all javascript code is being run inside a code block such as:

    $(document).ready(function () {
    //your code here
    });
    This will ensure that your code is being loaded after jQuery has been initialized.

    One final thing to check is to make sure that you are not loading any plugins before you load jQuery. Plugins extend the “$” object, so if you load a plugin before loading jQuery core, then you’ll get the error you described.

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

Sidebar

Related Questions

This is my code. <form name=publish> <?php include 'location.selector.html'; ?> <input type=submit value=submit/> </form>
<?php $name=$_POST['name']; ?> <form method=POST action=<?php echo $_SERVER['PHP_SELF']; ?>> <input type=text name=name> <input type=submit
In my CMS I've added this code <div><?php include(my_contact_form.php) ?></div> which updates to a
I'm looking for a little help structuring a web form to include PHP validation
I am trying to include a .php file that will generate a form for
edit/operacoes.php header('Content-Type: application/json'); include('../../lib/mysql.class.php'); $db = new MySQL(); if($db->Error()) $db->Kill(); //VARIÁVEIS DA FORM $id
This is user.php: include(databse.php);//retrieving successfully first name and lastname from databse file into user.php
I have this form that pops up in a modal window like so: <?php
receiving error: PHP Notice: Undefined index: mode in /web/ee_web/include/form-modal.php on line 51 line 51
Stuck with a jquery ajax form submission! Here's the code snippet: Javascript/ HTML Code:

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.