将jQuery Mobile与Facebook Like和Twitter Tweet集成 [英] Integrating jQuery Mobile with Facebook Like and Twitter Tweet

查看:87
本文介绍了将jQuery Mobile与Facebook Like和Twitter Tweet集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的第二页上集成JQM和Facebook Like和Twitter Tweet。第二页是使用锚标记,然后使用AJAX请求第二页加载第一页。

I'm trying to integrate JQM with Facebook Like and Twitter Tweet on my second page. The second page is loaded by first page using anchor tag then using AJAX request for second page.

问题是,Facebook和Twitter的javascript脚本加载时没有加载第二页。

The problem is that the Facebook and Twitter javascript scripts are not loading when loaded with second page.

我可以关闭AJAX,但我不想要此功能作为权衡。

I can turn off AJAX but I do not want this feature as a trade-offs.

有一种方法,我们可以在JQM上的AJAX请求后,在特定页面上重新加载js脚本? (我认为这应该工作类似于jQuery的live函数)。

Is there a way we can re-load the js scripts on specific page after AJAX request on JQM? (I think this should work similar to jQuery live function).

我使用Cakephp 2.0.4

I'm using Cakephp 2.0.4

推荐答案

您使用的是正确的页面标准吗?您需要在 data-role =page元素中加载脚本,因为这是JQM框架从AJAX请求中提取的内容。

Are you using the proper page standards? You'll need to load the scripts inside the data-role="page" element because that's what the JQM framework extracts from the AJAX request.

<div data-role="page"> 
    <!-- Scripts here -->
</div> 

docs - http://jquerymobile.com/test/docs/pages/page-anatomy.html

docs - http://jquerymobile.com/test/docs/pages/page-anatomy.html

这篇关于将jQuery Mobile与Facebook Like和Twitter Tweet集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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