开发者

ajax and linked resources

There must be something I don't understand about ajax. I want to display part of page (page B) on another page (Page A) using ajax. But linked page (page B) depends on some linked resources (page C) and these resources don't display on the original page (Page A). Is there anyway around this?

Here's the script (from Page B) I want to display on the original page (page A) using ajax:

echo "<p>To comment, please first prove that you are human being</p>";
echo "<form method='post' action='../recapatcha_verify.php'>";
 require_once('../../phpfunctions/recaptchalib.php');
  $publickey = "key"; // you got this from the signup page
 echo recaptcha_get_html($publickey);
 echo "<input type='submit' />";
    echo "</form>"

When this page is called through ajax -- the开发者_运维技巧 <p> element shows up as well as the form and submit button. But the recapatcha widget accessed through linked resource (page C) does not show up. I know script works however, because if I load the page itself (page B) everything is fine.

Any thoughts? suggestions? thanks


Your recaptcha is likely injected into the page by running a script. <script>s do not get automatically evaluated when you inject them into a page (Page A). You can, for example, use jquery's $.ajax() method to do this though.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜