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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:37:02+00:00 2026-06-08T01:37:02+00:00

First sorry if its a stupid question but i ran into a problem what

  • 0

First sorry if its a stupid question but i ran into a problem what i cant really solve.
I am loading a html file with the load function, and my problem is if i load the html file with the load function, the selectors with jquery dont really work, only with css.

(i use codeigniter)

example

load the html

$('.get_posts').hide().load('stream/load_posts').fadeIn(800);

so this html (view) file contains the following

<?php if(isset($stream_posts)): ?>
<?php foreach($stream_posts as $sp): ?>
<div id="sp_<?php echo $sp->sid; ?>" class="row stream-posts">
    <div class="span1 stream-thumb">
        <ul class="stream-thumbnails unstyled">
          <li>
            <a href="#" class="stream-thumbnail">
              <img src="http://placehold.it/60x60" alt="">
            </a>
          </li>
        </ul>
    </div>  
    <div class="span5 stream-content">
        <a href="#" class="author"><?php echo $sp->first_name ." ". $sp->last_name; ?></a>
        <p id="stream-text"> 
            <?php echo nl2br(auto_link($sp->text)); ?>
        </p>
    </div>
</div>
<?php endforeach; ?>
<?php endif; ?>

i use codeigniter so at this line <?php echo nl2br(auto_link($sp->text)); ?> Automatically turns URLs and email addresses contained in a string into links, so when i have an auto link i would like to add an oembed class to it, so i tried the following

$("p.stream-content a").addClass('oembed');

and its not working, tried with css with the same selector with difference by coloring the anchor tags red, in css it works, than i discovered, the jquery selector part its not working because i use load, if i uncomment load and show the results via php it adds the class fine with jquery too.

Could please someone give me a hint for this?

Thank you

  • 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-08T01:37:03+00:00Added an answer on June 8, 2026 at 1:37 am

    Did you try adding the class on the callback of load()?

    $('.get_posts').hide().load('stream/load_posts', function() {
      $("#stream-text a").addClass('oembed');
    }).fadeIn(800);
    

    Note that I have changed your $('p.stream-content... because there is no <p> element with class="stream-content"

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

Sidebar

Related Questions

first sorry if its a stupid question but im lost a bit. So when
First sorry if its a stupid guestion but im a really big beginner. I
Hello first sorry if its a stupid question, but I amm a beginner, and
First of all sorry if its a noob question. But is it posibble to
First of all sorry if it's a dumb question (and surely it is), but
First of all I am sorry for the stupid question I am going to
Sorry if this is a stupid question, but it's something that I'm curious about.
I'm really sorry if this come across as stupid but i've searched everywhere but
First, sorry for my stupid title :) And here is my problem.. Actually it's
Maybe it's a similar beginning, but it's true. first of all sorry if this

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.