Ahs*_*san 0 javascript php facebook fbml fbjs
我在Facebook上有一个基于iFrame的应用程序,可以实现它应有的功能.它以PHP为基础.但是,只要我放了一些Javascript函数,它就会停止工作!
我最初尝试做的是看看我是否有用户授权.如果我没有,我将用户发送到facebook的授权页面.这是代码:
<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>
Run Code Online (Sandbox Code Playgroud)
但是,我在firefox中遇到这个脚本的错误,它是:
Error: document.getElementById("uname").getValue is not a function
Source File: <some page>
Line: 19
Run Code Online (Sandbox Code Playgroud)
有谁可以让我知道我在做错了什么?
谢谢.
- 啊
| 归档时间: |
|
| 查看次数: |
694 次 |
| 最近记录: |