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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:39:37+00:00 2026-06-08T02:39:37+00:00

I have this jq function to open a link inside a div: $(document).ready(function() {

  • 0

I have this jq function to open a link inside a div:

$(document).ready(function() {
    $('#all').delegate('a', 'click' (function() {
        $('#content').empty();
        var page = $(this).attr("id");
        $('#content').load("scripts/loop_a.php?page=" + page);
    });
});

I call this inside the head tag of my index.php and is working for all links that are in my header_template.php

If I load a new.php page inside my main_body div and it has a link inside, that link does not work with my script, (basically my new.php page doesn’t see my .js file).

Is there a way to make it work for any new .php file that I open by calling the .js file only in my index.php?

Thank you

Edit… Solution Found… I edided the script above.

In my index.php I am using which includes everything that happens.
So I just chose that div and I delegate all the functions that I needed to work when loading/opening new.php files.

Thank you all for your help.

  • 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-08T02:39:38+00:00Added an answer on June 8, 2026 at 2:39 am
    $(document).ready(function() { 
        $('#all').delegate('a', 'click' (function() { 
            $('#content').empty(); 
            var page = $(this).attr("id"); 
            $('#content').load("scripts/loop_a.php?page=" + page); 
        }); 
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<head> <script type=text/javascript> $(document).ready(function(){ $(.open_list).hide(); $(.trigger).click(function(){ $(this).toggleClass(active).next().slideToggle(800); }); }); </script> I'm doing a list
I have this little function function makewindows(){ child1 = window.open (about:blank); child1.document.write(<?php echo htmlspecialchars(json_encode($row2['ARTICLE_DESC']),
I have a link that is located inside a content control. This link calls
i'm using autocomplete from jquery... and i have this: $('#name_search').autocomplete({ source: search/name.php, open: function(){
I have this code in userpage.php: <script langauge=JavaScript><!-- function newWindow(fileName,windowName) { msgWindow=window.open(fileName,windowName); } //--></script>
I have a simple accordion menu using jQuery. When I click a link inside
I have the following code: $(.perf-row).click(function(e) { if (e.target.tagName.toLowerCase() == a) { pageTracker._trackPageview($(this).attr(rel)); return
My page inicio.html currently contains this script: $(document).ready(function() { $(#my_site_content).load(inicio.html); }); and in a
I have this simple code, where on live(click:) an external link is called through
I have this generic javascript function to open a window: function OpenWindow(url,windowname,wide,high) { spop=window.open(url,windowname,width=+wide+,height=+high+,scrollbars=1,resizable=1,statusbar=1,menubar=0);

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.