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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:31:08+00:00 2026-06-01T18:31:08+00:00

I have made a jquery functions which suppose to do 3 steps onload it

  • 0

I have made a jquery functions which suppose to do 3 steps

  1. onload it should replace attributes of all link files
  2. when clicking it should load a sub page into $(“#content”)
  3. again it should refire the function which would replace all links again

the following code works till 2 steps but doesnt fire third step which should replace all urls again I think it should replace also the links of loaded page?

$(document).ready(function(){
   var base_url = "http://localhost/dolphin/";
   $("a").each(function(e){
   if(this.href == "javascript:void(0)" || 
        this.href == base_url || 
        this.href == base_url + "index.php" || 
        this.href == "javascript:void(0);" || 
        this.href == "javascript:%20void(0)") {

     }else{
       page = 'Javascript:LoadPage(\''+ this.href + '\')';
       this.setAttribute('onclick',page);
       this.setAttribute('href', '#');
     }
   });
});

function LoadPage(url){
   $("#contentarea").load(url, function() {
     //after loading it should call redoIt() but it doesnt.
      redoIt();
   });
}

function redoIt(){
    var base_url = "http://localhost/dolphin/";
    $("a").each(function(e){
       if(this.href == "javascript:void(0)" || 
          this.href == base_url + "index.php" || 
          this.href == "javascript:void(0);" || 
          this.href == "javascript:%20void(0)") {

       }else{
         page = 'Javascript:LoadPage(\''+ this.href + '\')';
         this.setAttribute('onclick',page);
         this.setAttribute('href', '#');
       }
   });
 }
  • 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-01T18:31:09+00:00Added an answer on June 1, 2026 at 6:31 pm

    Your call to $.load is inside a function, and from what I gather you’re not calling that anywhere so it’s not getting executed. Take it out and it should work fine

    $("#contentarea").load(url, function() {
    
    //after loading it should call redoIt() but it doesnt.
     redoIt();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a Web page using jquery and php where all files are
I have made a map with jQuery which is split up in many regions,
I have a div element which is made jquery Resizable. It has alsoResize option
I have made a image gallery with jQuery found here: http://sarfraznawaz2005.kodingen.com/demos/jquery/image_gallery/ I just wanted
I have made a particle generator with Jquery it works fine but it is
I have made a table row draggable with jQuery. It works as expected (mostly)
Using jQuery UI's Droppable I have made a shelf type thing where the items
I have started using jQuery and rails. I have made a simple form that
I have a drop down menu made with Jquery. Right now, if you hover
I have a sliding div menu made with jQuery, but you have to click

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.