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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:43:14+00:00 2026-05-16T02:43:14+00:00

Working on the same page as before,but now I’m using it as a playground

  • 0

Working on the same page as before,but now I’m using it as a playground for messing around with jQuery so I can learn it for my’boss.’ Unfortunately, I can’t get the javascript in this file to execute, let alone give me a warning. All of the PHP and HTML on the page work perfectly, it’s just the script that’s the issue. What am I doing wrong?

<?php

  if( isset($_POST['mushu']) )
  {
    playAnimation();
    clickInc();
  }

  function playAnimation()
  {
     echo "<img src='cocktail-kitten.jpg' id='blur'>";
  }

  function clickInc()
  {
    $count = glob("click*.txt");

    $clicks = file($count[0]);
    $clicks[0]+=1;

    $fp = fopen($count[0], "w") or die("Can't open file");
    fputs($fp, $clicks[0]);
    fclose($fp);

    echo $clicks[0];

  }
?>

<html>

  <head>

    <title>Adobe Kitten</title>

    <script type="text/javascript" src="jquery.js"></script>

  </head>

  <body>

    <form action="<?php $_SERVER['PHP_SELF']; ?>"
          method="post">
    <input type="submit"
           value="Let's see what Mushu is up to."
           name="mushu">
    </form>

    <script>
      $(document).ready( function()
      {
        $('#blur').click( function()
        {
          $(this).blur( function()
          {
            alert('Handler for .blur() called.');
          });
        });
      });
    </script>
  </body>
</html>
  • 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-05-16T02:43:15+00:00Added an answer on May 16, 2026 at 2:43 am

    You’re calling playAnimation() before your <html> tag, so your html is malformed. JQuery probably can’t find the #blur element because it’s not actually inside your web page, much less within the <body>.

    Move the if( isset($_POST['mushu'])) ... block of code somewhere after the body tag.

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

Sidebar

Related Questions

Hi It might be asked before but I am new to Jquery and using
Why isn't my code around the test function in Object RegExp working the same
We are working with severall people on the same project and are using Mercurial
I'm again lost with CakePHP. Before site was using static one page invite for
I tried to run 2 JQuery-ajax at the same time, but it's seem always
The Issue: when multiple users have access to the same working directory, permissions issues
We are two companies who are working on the same project, in the same
We have three developers and one tester all working against the same database. We
In C++ one might use namespace to keep independent groups working in the same
I'm working with a script that is calling the same class twice and throwing

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.