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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:36:14+00:00 2026-05-18T08:36:14+00:00

Im a newbie to jquery. I really require assistance with putting jquery in my

  • 0

Im a newbie to jquery.
I really require assistance with putting jquery in my code

i have some links i.e. link1 link2 link3

i also have a div tag <div class="vid"></div> WHICH IS WHERE THE VIDEOS OBTAINED WILL BE APPENDED.

I have a php page that fetches A STREAMING video with an <object> tag FROM MANY 4 IP CAMERAS

what i’m trying to do is when i click on the link[i] with href="page?ip="ipadd, i want the video jquery to fetch the page that calls the video and APPEND it to the div tag.

I was thinking of being able to send a get request with the ip address (which is the href on the links) to the php page handling the video, so it can use the ip address to pick the correct video from the correct video (IM STREAMING THEM FROM AN IP CAMERA.) That is why i want to use jquery to load each video as the link is being clicked. But i really have no clue on how that works.


Ok Gaby i have added a line check my sample page now i added the

 $('a.video-link').click(function(event){
 event.preventDefault(); ....} 

my page now becomes

<html>
<head>
<script type="text/javascript" src="jsfile.js"></script>


</head>
<body>

<a href="akin3.html" class="video-link" >link 1</a>
...

<div class="vid" >
</div>
<script>
$(document).ready(function(){
$('a.video-link').click(function(event){
 event.preventDefault();
  // get the contents of the clicked Url and then append them at the div with class vid
  $.get( this.href, 
         function(data){  
               $('.vid').append( data ); 
         }
       );
  return false;
});
});
</script>
</body>
</html>

but when i click on the link it appends. if i try to click a link that i have clicked previously, it clears the div tag and jumps to the link that i an clicking the second time. i need it to append that link still(being able to append a link multiple time). any 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-05-18T08:36:15+00:00Added an answer on May 18, 2026 at 8:36 am

    add a class to your links for example video-link

    <a href=".." class="video-link">link 1</a>
    <a href=".." class="video-link">link 2</a>
    

    and use

    $('a.video-link').click(function(){
      // load and put the contents of the url in the div with class vid
      $('div.vid').load( this.href );
      return false;
    });
    

    reference: the .load() method

    The above solution will replace the contents of the vid div.


    If you want to append it at the end (keeping the current contents) then use

    $('a.video-link').click(function(){
      // get the contents of the clicked Url and then append them at the div with class vid
      $.get( this.href, 
             function(data){  
                   $('div.vid').append( data ); 
             }
           );
      return false;
    });
    

    reference: the .get() method

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

Sidebar

Related Questions

No related questions found

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.