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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:37:05+00:00 2026-06-17T20:37:05+00:00

I am trying to make the links not do the default action as going

  • 0

I am trying to make the links not do the default action as going to the link, instead when user clicks the link it does the rest of the code which, in this case loads the appropriate url elements that I am calling with AJAX and place them in the correct Divs/span. Here is the code…

 $(function(){
    $('body').append('<span id="view_mess">New Message</span><div id="mess_wrapper"><div id="new_mess_pop"><div id="button_wrap"><span id="post_date_time"></span><div id="users_contact_info"><div id="users_image"></div><div id="message_lister"></div></div><div id="message_post"></div><div id="inner_mess_wrapper"></div></div></div></div>');
      $('#message_lister').load('/privmsg?folder=inbox .tdtopics:lt(5)');
        $('#view_mess').click(function() {
      $('#mess_wrapper').show();
       });
 $('.topictitle').click(function(e) {
  var msg = $('.tdtopics a').attr('href');
   $.get(msg, function (data) {
     var elems = $(data);
      $('#post_date_time').append(elems.find('div.posthead h2'));
      $('#users_image').append(elems.find('.user-basic-info'));
      $('#message_post').append(elems.find('.entry-content'));
   }, 'html');
e.preventDefault();
  $('#mess_wrapper').show();
 });

I’ve tried e.preventDefault(); where it is in the above code and right after the function code. Maybe I should write the e in the first function?

  • 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-17T20:37:06+00:00Added an answer on June 17, 2026 at 8:37 pm
    Try with this :
    Two things :you missed the end bracket of function  and e.preventdefault shuld be in start of the event 
    
    
    
     $(function(){
        $('body').append('<span id="view_mess">New Message</span><div id="mess_wrapper"><div id="new_mess_pop"><div id="button_wrap"><span id="post_date_time"></span><div id="users_contact_info"><div id="users_image"></div><div id="message_lister"></div></div><div id="message_post"></div><div id="inner_mess_wrapper"></div></div></div></div>');
          $('#message_lister').load('/privmsg?folder=inbox .tdtopics:lt(5)');
            $('#view_mess').click(function() {
          $('#mess_wrapper').show();
           });
     $('.topictitle').click(function(e) {
     e.preventDefault();
      var msg = $('.tdtopics a').attr('href');
       $.get(msg, function (data) {
         var elems = $(data);
          $('#post_date_time').append(elems.find('div.posthead h2'));
          $('#users_image').append(elems.find('.user-basic-info'));
          $('#message_post').append(elems.find('.entry-content'));
       }, 'html');
      $('#mess_wrapper').show();
     });
    
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make this be a link to a destroy action for a
I'm trying to make an application where the user can override the default behaviour
I am trying to make a list of links, 6 links in a row.
I am trying to make Link Web / link info directory in C# where
I'm trying to make my tumblr posts link directly to the source when clicked
I am trying to make a row in a table link to the edit
I'm trying make a login window where a user is prompted to enter their
I am trying to make an application using AppleScript which can remind to check
I'm trying to make a meta-language for writing markup code (such as xml and
Im trying to make automatic deployment including supervisord and confused by default settings path.

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.