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

The Archive Base Latest Questions

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

I have four php pages: header.php demo1.php demo2.php demo3.php I am including header.php in

  • 0

I have four php pages:

  1. header.php
  2. demo1.php
  3. demo2.php
  4. demo3.php

I am including header.php in every page i.e demo1.php, demo2.php and demo3.php. I included common JavaScript required for demo1.php, demo2.php and demo3.php in header.php.

header.php code:

<script type="text/javascript" src="jscript/jquery.js"></script>
<script type="text/javascript" language="javascript">
$(function(){
     $("#btn1").click(function(){
       console.log("btn1 clicked");
      });
     $("#btn2").click(function(){
      console.log("btn2 clicked");
     });

});
</script>

btn1 and btn2 elements are not declared in header.php, but they are declared in included pages like demo1.php, demo2.php and demo3.php.

demo1.php code:

 <?php include "header.php";?>
 <input type="button" id="btn1" value="check"/>
 <input type="button" id="btn2" value="check"/>

This demo1.php page works in all browsers except in IE.

In IE it showing error Object expected at $("btn1").click(function(){});.

Can any one help me achieving this problem?

  • 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-17T04:32:37+00:00Added an answer on June 17, 2026 at 4:32 am

    You may have an implicit semicolon or append at this line:

    $("#btn1").click(function(){
    

    It could also be an issue caused by the base element.

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

Sidebar

Related Questions

I have a PHP page powered by jQuery. A singel page has four steps,
I have an application that has an included header file in each page. The
I have the following PHP Classes class.property.php class.location.php class.amenity.php class.category.php all four classes handles
It seems to me from the following page http://www.eclipse.org/eclipse/platform-team/target.php and other pages like it.
I have a rewrite rule that works for my index page RewriteRule ^index$ index.php
I have four urls I want to have rewritten. domain.com/index.php?id=1234 => domain.com/1234 domain.com/a.php?id=1234 =>
If this were just a static website, i would have four links <li><a href=javascript:void(0)>Action
Lightbox gallery style, I have four pictures shown on one page, if I move
I have a problem going from page one to page two, three, four, etc...
I have four elements on a page, elements 1 - 4 in that order

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.