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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:44:06+00:00 2026-05-16T07:44:06+00:00

So I have a script like this <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js> </script> <script type=text/javascript> $(document).ready(function(){

  • 0

So I have a script like this

    <script type="text/javascript"
            src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js">
    </script>
    <script type="text/javascript">
       $(document).ready(function(){
       $("a[href*='http://']:not([href*='"+location.hostname+"'])").attr("target","_blank");

       $("a[target!='_blank'][target!='_top']").click(function(){

       var url=$(this).attr("href")+'?jquery=1';
       ajaxpage(url,'actualcontent');

       window.location.hash=$(this).attr("href");
        return false;
    });


});
    </script>

and it works great. It means all my links load dynamically within the DIV – awesome. But, the links loaded in those div, don’t load dynamically when clicked. and if I include this script in it, it still doesn’t work. And on a similar note, is there a way of making javascript in pages, which have been loaded dynamically, work? Without including it in the original header?

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-16T07:44:07+00:00Added an answer on May 16, 2026 at 7:44 am

    Disclaimer: To use this solution, you’ll need to upgrade to jQuery 1.3 or jQuery 1.4+
    (But you should, there are many performance improvements and bug fixes since 1.2.6)


    Instead of .click() you can use .live() here, like this:

    $("a[target!='_blank'][target!='_top']").live('click', function(){
    

    .live() works on dynamically added elements as well, since it’s listening for the bubbling click event at document, rather than being a handler on the element itself.

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

Sidebar

Related Questions

I have a django template that looks like this: <head> <script src=http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js type=text/javascript></script> <script
I would like to have a script in the head like this: <script type=text/javascript
i have code like this: <script type=text/javascript> var _gaq = _gaq || []; _gaq.push(['_setAccount',
I have a URL that resides on another domain, like this: http://ads.adserver.com/ad?site=1233&zone=45435 When you
So I have a URL like: http://maps.googleapis.com/maps/api/geocode/json?&sensor=false&address=1330+SW%203rd%20Ave,%20Portland,%20OR But it returns just JSON. Im looking
If I have a script tag like this: <script id = myscript src =
I have script like this : fullscript.sh if [ ! -f /opt/laks/linux-2.6.33.2.tar.bz2 ] then
I have a script that looks like this #!/bin/bash function something() { echo hello
I have a batch script that looks like this: Test.bat @echo off :: Starts
I have a bash script that looks like this: #!/bin/sh previousRelease=`git describe --tags --match

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.