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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:37:21+00:00 2026-05-12T09:37:21+00:00

I have a -link element that has href link to page, but I have

  • 0

I have a -link element that has href link to page, but I have to use Ajax to load that content from href -url and not redirect user to that page. How can I modify my link to just load content from that link, so I can inject that content to current page?

<a class="bind-jquery-event-here-class" href="http://webpage.com">Link</a>

I made this, but it doesn’t work.

$(".bind-jquery-event-here-class").bind("click", function() {       
    var url = $(this)attr("href").val();
    var content = $.load(url);
    alert(content);
});
  • 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-12T09:37:21+00:00Added an answer on May 12, 2026 at 9:37 am

    The load function is not intended to gather the request response, this function is used to load HTML from a remote file and inject it to a DOM element, for example:

    $('a').bind('click', function(e) {           
      var url = $(this).attr('href');
      $('div#container').load(url); // load the html response into a DOM element
      e.preventDefault(); // stop the browser from following the link
    });
    

    If you handle click events of anchor elements you should prevent the browser from following the link href.

    Also keep in mind that Ajax request can be done only withing the same domain due the Same Origin Policy.

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

Sidebar

Related Questions

I have a link that opens a Thickbox... <a href=page.php?tag=lists-element&keepThis=true&TB_iframe=true&height=450&width=500> Everything works with this
I have an element like so: <a class='link' href='/page1'>Page 1</a> It has a click
I have a url on my page which has a dynamic element... <a class=TOPHEADING
I have an html that has a link: <a id=myLink href=/aa.html title=New Bangoo class=bangoo>Bangoo</a>
I have a href element and that has onclick event on it. I want
I have link that calls a function when clicked: <a href=javascript:spawnMenu(this); id=link1>Test1</a> To make
I have a link on a page that pops up a new window, and
I have a page in my site that has allows users to search for
I have a page that I'm working on that has the following HTML markup:
In my web application I have a user profile page. That page has these

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.