Jump to content

Evaluating JavaScript Received From Ajax Request


tmh766

Recommended Posts

Hi everyone.

 

I have never done anything like this and can't seem to figure out a solution.

 

I have a page with a div whose content is reassigned onclick by way of an Ajax request. Here is the part I can't figure out. The div's content (a bunch of text comments and a reply box) uses JavaScript to move the reply box up and down to each comment when clicked, and more importantly, to set an ID variable, in the form (which contains the comments and reply box) so when posted, the server knows which comment is being replied to.

 

Does anyone have an idea on how I can get the JavaScript within the returned text from the Ajax request to be evaluated? I can't seem to figure out a way. The Ajax request and is completed successfully, the returned HTML snippet is evaluated and rendered, but not the JavaScript that accompanies it.

 

Thanks a lot for your time, I would greatly appreciate any insight on this problem,

Tim

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.