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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:47:16+00:00 2026-05-30T01:47:16+00:00

i have this script on the page where i want to load the file

  • 0

i have this script on the page where i want to load the file

<SCRIPT type="text/javascript">
$(function() 
{           
        $("#storefront").click(function () {
            alert("POTANGINA");
           $(".centerdiv").load("storefront_a.php");
       });  

});             
</SCRIPT>

and i have this script on the page i want to load (storefront_a.php)

<SCRIPT type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></SCRIPT>
<SCRIPT type="text/javascript" src="http://cssglobe.com/lab/easypaginate/js/easypaginate.js"></SCRIPT>
<script type="text/javascript">

    jQuery(function($){

        $('ul#items').easyPaginate({
            step:5
        });

    });    

</script>

<style>
        #page li {
          display: inline;
          position: relative;
          width: 11em
          margin:10px; 
          padding:10px;
        }
        #page li li{ display: block; height: 1.5em;}

</style>


<div id = "page">       
<ul id="items">
    <li>Page 1</li>
    <li>Page 2</li>
    <li>Page 3</li>
    <li>Page 4</li>
    <li>Page 5</li>
    <li>Page 6</li>
    <li>Page 7</li>
    <li>Page 8</li>
    <li>Page 9</li>
    <li>Page 10</li>
    <li>Page 11</li>
    <li>Page 12</li>
    <li>Page 13</li>
    <li>Page 14</li>
</ul>
</div>

when i ran the storefront_a.php directly from the localhost it worked. but when i call it using load() it is actually loading but the javascript did not worked. PLease help me thanks

  • 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-30T01:47:17+00:00Added an answer on May 30, 2026 at 1:47 am

    If storefront element is added dynamically then click will not work because jQuery cannot attach event handler if the element is not available on page load.

    You have to basically use delegate or on to add event handlers for dynamically created elements.

     $(document).on("click", "#storefront", function () {
         alert("POTANGINA");
         $(".centerdiv").load("storefront_a.php");
     }); 
    

    Instead of document you can specify the parent container of storefront element which will be available on the page.

    Note that on is introduced in jQuery ver 1.7. If you are using older version then use delegate

     $(document).delegate("#storefront", "click", function () {
         alert("POTANGINA");
         $(".centerdiv").load("storefront_a.php");
     }); 
    

    References:

    • .on() – http://api.jquery.com/on/
    • .delegate() – http://api.jquery.com/delegate/
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, I have this code: <script language=javascript type=text/javascript> <!-- function requestPage(page) { var request
Say I have this code in my page: <script language=javascript> $(document).ready(function() { $(.test).click(function() {
I have this script loaded on a page: (function() { window.alert('bookmarklet started'); function AjaxSuccess(data,
I have this script on my html page: <script language='javascript'>parent.resizeTo(550,510);</script> I'd like to add
I have this jQuery script var dataString = class_id=+class_id; $.ajax({ type: POST, url: page.php,
I have page for which I want to load different template file for different
Basically i want to load JS file like this into the page dynamically globalVar
i have this script $content = string if(!isset($_GET['page'])){ $page = 1; } else{ $page
Suppose I have something like this page: <noscript>You need JS for this page</noscript> <script>
I have this script to generate an XML file for an RSS feed. Works

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.