如何移动AJAX'd内容在Javascript瓦特/ Moovweb SDK? [英] How to move AJAX'd content in Javascript w/ Moovweb SDK?

查看:109
本文介绍了如何移动AJAX'd内容在Javascript瓦特/ Moovweb SDK?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以有时与Moovweb SDK在内容点工作,当客户端将AJAX,但它会在不正确的区域?

So sometimes when working with the Moovweb SDK a client will AJAX in a content spot, but it will be in the incorrect area?

我不能用氚移动此内容,因为该地区我想将它移动到的页面加载后插入!

I cannot use tritium to move this content, because the area I want to move it to is inserted after page load!

例如:

<div class="where-i-want-to-move-it"></div>

<div class="content-area-i-want-it-moved-from">
  <p class="content-i-want-moved">Hi! This was ajaxed in at a later date!</p>
</div>

我怎么可以检测到这个p标签是通过AJAX加入时,我无法控制自己的JS来触发一个特定的事件或触发不同的回调?

How can I detect that this p tag was added through AJAX when I cannot control their JS to fire a specific event or fire a different call back?

推荐答案

一个办法是听节点发生变化 - 请参阅这帖子 - 假设你可以瞄准正确的突变事件,在JavaScript中手动移动量

One option would be to listen to node changes -- see this post -- and assuming you can target the correct mutation event, move the content manually in JavaScript.

这篇关于如何移动AJAX'd内容在Javascript瓦特/ Moovweb SDK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆