-3

I am in the process of loading paragraphs from php files, which I then include on my site using the include_once method. The first paragraph loads as soon as the page loads. The problem is: when I try to implement js (jQuery) on certain elements within the php files (the first paragraph in particular), they do not seem to respond to the script. Is there any way of fixing this and what would be the best of going about this?

Thanks a lot.

I have chopped out the bits of relevant code:

JS:

$('button').click(function() {
$('.target').load('more.php');
});

$('.target').hide().fadeIn(2000); //this is the part not working (I wanted to fade in the loaded php)

*Just to clarify, the file loads fine, just the fadeIn and other similar effects do not take place.

Thanks in advance.

ar002
  • 9
  • 2

1 Answers1

0

When we include php files in main php file . It becomes the part of main php file and makes a document object model. If you want to select the paragraph better way is to give some id to that paragraph and then select it using jquery using there id.

Mithilesh Jha
  • 175
  • 1
  • 11