Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iframe在sencha Touch中_Iframe_Sencha Touch_Sencha Architect_Facebook Iframe - Fatal编程技术网

Iframe在sencha Touch中

Iframe在sencha Touch中,iframe,sencha-touch,sencha-architect,facebook-iframe,Iframe,Sencha Touch,Sencha Architect,Facebook Iframe,我需要在我的Android应用程序中使用类似facebook的按钮iframe…如果我使用此代码,我会在我的PC桌面上看到它,但在Android中看不到任何东西 你知道为什么以及是否存在一种在Android中显示like按钮的方法吗? 我正在使用Sencha Architect和Touch 2.3 多谢各位 就像你说的那样 这是我的代码: htmlStrBase1 = '<iframe src="//www.facebook.com/plugins/like.php?href=https%

我需要在我的Android应用程序中使用类似facebook的按钮iframe…如果我使用此代码,我会在我的PC桌面上看到它,但在Android中看不到任何东西

你知道为什么以及是否存在一种在Android中显示like按钮的方法吗? 我正在使用Sencha Architect和Touch 2.3 多谢各位

就像你说的那样

这是我的代码:

htmlStrBase1 = '<iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fopticaltrend12345%2F&amp;width&amp;layout=button&amp;action=like&amp;show_faces=false&amp;share=false&amp;height=35&amp;appId=780849738633803" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:35px;" allowTransparency="true"></iframe>';
component.add({
        xtype: 'container',
        id: 'fb-root',
        width: 50,
        height: 20,
        flex:1,
    listeners: {
        initialize : function (container) {
            (function(d, s, id) {
                var js, fjs = d.getElementsByTagName(s)[0];
                if (d.getElementById(id)) return;
                js = d.createElement(s); js.id = id;
                js.src = "//connect.facebook.net/en_US/all.js";
                fjs.parentNode.insertBefore(js, fjs);
            }(document, 'script', 'facebook-jssdk'));
            container.setHtml(htmlStrBase);
        }
    }
});

如何添加它。在一个带有setHtml或…的容器中,正如您所说。我创建了一个容器,然后设置了一个HTMLhmmm。如果你使用一个容器,那么容器内有严重的div。这样,fb-root.x-inner.x-innerHtml才是真正的fb html部分的起点。您是否尝试使用组件而不是容器。你应该建立一个fb自定义组件。你能给我写一个小例子吗?看看你的project.touch.src.Button.js在模板部分你可以定义一个div或span。。。并添加文本或html。每次configItem更改时都会调用updateConfigItem。这会让你更好地控制你的fb。
htmlStrBase1 = '<iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fopticaltrend12345%2F&amp;width&amp;layout=button&amp;action=like&amp;show_faces=false&amp;share=false&amp;height=35&amp;appId=780849738633803" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:35px;" allowTransparency="true"></iframe>';
component.add({
        xtype: 'container',
        id: 'fb-root',
        width: 50,
        height: 20,
        flex:1,
    listeners: {
        initialize : function (container) {
            (function(d, s, id) {
                var js, fjs = d.getElementsByTagName(s)[0];
                if (d.getElementById(id)) return;
                js = d.createElement(s); js.id = id;
                js.src = "//connect.facebook.net/en_US/all.js";
                fjs.parentNode.insertBefore(js, fjs);
            }(document, 'script', 'facebook-jssdk'));
            container.setHtml(htmlStrBase);
        }
    }
});