dsj8086 2011-04-04 13:09
浏览 44
已采纳

Javascript功能无法正常工作/在Facebook上基于iFrame的应用程序中出错! [关闭]

I have a iFrame based app on Facebook which does what its supposed to. Its PHP-based. However, as soon as I put some Javascript function, it stops working at all!

What I am initially trying to do is to see if I have authorization for the user. If I dont have it, I send the user to the authorization page of facebook. Here's the code:

<script>
    function submitMappingForm() //for mapping 
    { 
        // declare a new FBJS AJAX object
        //var ajax = new Ajax(); 
        //ajax.responseType = Ajax.FBML;

        // define a callback to handle the response from the server
        //ajax.ondone = function(data) 
        //{ 
            //document.getElementById('stat').setInnerFBML(data);
        //}

        // let the user know we're sending the data 
        //document.getElementById('stat').setInnerXHTML('Submitting your information, please wait...');

        // collect field values
        var queryParams = { 'uname' : document.getElementById('uname').getValue(), 'upass' : document.getElementById('upass').getValue(), 'user_id' : document.getElementById('userID').getValue() };
        ajax.post('http://abcd.com/efg.php', queryParams);
        return true;
    }
</script>Welcome!<script> top.location.href='http://www.facebook.com/dialog/oauth?client_id=123456789&redirect_uri=http%3A%2F%2Fapps.facebook.com%2Fsomeapp%2F'</script>

However, I am getting an error with this script in firefox which is:

Error: document.getElementById("uname").getValue is not a function
Source File: <some page>
Line: 19

Can anyone kindly let me know what I am doing wrong here ?

Thanks.

- ahsan

  • 写回答

1条回答 默认 最新

  • duanchen1937 2011-04-04 13:11
    关注

    Your first closing script tag is spelt incorrectly. </scrpt>

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 phython如何实现以下功能?查找同一用户名的消费金额合并—
  • ¥15 孟德尔随机化怎样画共定位分析图
  • ¥18 模拟电路问题解答有偿速度
  • ¥15 CST仿真别人的模型结果仿真结果S参数完全不对
  • ¥15 误删注册表文件致win10无法开启
  • ¥15 请问在阿里云服务器中怎么利用数据库制作网站
  • ¥60 ESP32怎么烧录自启动程序
  • ¥50 html2canvas超出滚动条不显示
  • ¥15 java业务性能问题求解(sql,业务设计相关)
  • ¥15 52810 尾椎c三个a 写蓝牙地址