Jump to content

JS not being applied on .load(ded) content


soltek

Recommended Posts

Hey guys,

 

I've been using JQuery for the last week (amazing stuff) and I've come to a problem.

 

What I did is this:

»A page with two buttons, each of them grabs another file from the server and display it on the div bellow. This using the .load function. (just like an old iframe)

 

That .load function loads a table that one has one toggle action. When you click on each row, it would slideDown another div.

 

And here's the problem, everything works fine, the .load and the slideDown, but after loading the content, the slideDown doesn't work anymore.

 

I think the problem is that the loaded page isn't being affected by the JS code contained in the header. As a test I made a simple hide-on-click on that page and that didn't work either.

 

So, my question is, after the page is .load(ed), I can't grab the content from the page where it is being loaded?

Thanks!

Link to comment
Share on other sites

Unless it's a function the Javascript executes with what's already on the page. If you load something new in Javascript doesn't recognise it. What you need to do is include the relevant Javascript at the bottom of your "other file", the one being called by Ajax.

 

Without seeing your code I can't offer any more advice than that.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.