Facebook 应用程序 - JavaScript 还是 PHP?
这是我第一次开发 Facebook 应用程序。事实上,这是我做过的第一个与网络相关的开发。我是软件开发人员。
我一直在做研究,发现我可以用任何我想要的语言编写应用程序,无论是 PHP、Python、JavaScript、Java、Ruby 等等。
因为我没有太多时间学习新东西,我选择了 JavaScript,我有移动开发经验。
我需要的是 iFrame 中的刮刮乐游戏。编写应用程序的最佳选择是什么?真的选择 JavaScript 还是选择 PHP+Flash 或者其他什么?
另外,如果有人知道我可以在哪里找到 Facebook Apps 示例代码,我将非常感激。
谢谢。
So, I'm working on a Facebook Application for the first time. Actually, it's the first web-related development I've ever done. I'm software developer.
I've been doing research and found that I can write my applications in whatever language I want, be it PHP, Python, JavaScript, Java, Ruby, etc., etc..
Since I don't have much time to learn something new, I chose JavaScript, which I have experience with for mobile development.
What I need is a Scratch and Win game in an iFrame. What is the best option to write the application with? Really go with JavaScript or perhaps go for PHP+Flash or something else?
Also, if someone knows of a place where I can find Facebook Apps sample codes, I'd be really thankful.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我真的认为你首先要学习服务器端脚本/编程语言。由于现代网络(应用程序或网站)不能再真正依赖静态页面(HTML)+客户端脚本语言。
虽然我建议您学习 PHP,因为它受到广泛支持,并且代码示例和片段随处可见,但您可能会发现学习如何使用 Java、Python 或 C# 等开发网站更容易,因为您是软件开发人员。
之后,对于您的特定请求(即刮即赢游戏),这取决于要求,因此您可能需要使用(在前端)Flash,或者如果要求灵活,那么您可以使用 HTML5 或可能简单的 jquery 插件 就可以完成工作!
请注意,您的应用程序可能不需要深入了解 Facebook 平台,并且您可以选择将与系统的交互保持在最低限度。无论如何,这里有一些资源:
I would really argue you learn a server-side scripting/programming language first. As the modern web (apps or websites) cant really rely on Static pages (HTML) + Client-side script language anymore.
While I would recommend that you learn PHP because it's widely supported and code samples and snippets are everywhere, you may find it easier for you to learn how to develop websites in Java, python or C# for example since you are a software developer.
Now AFTER that, and for your specific request (scratch-n-win game) it depends on the requirements so you may need to use (in the front-end) Flash or if the requirements are flexible then you can use HTML5 or maybe a simple jquery plugin will get the job done!
Just a small note, your application may not require a deep understanding of the Facebook Platform and you may choose to keep the interaction with the system to the minimal. Anyway, here are a couple of resources:
PHP 是唯一官方支持的后端语言,Facebook 维护该库。所有其他后端语言主要由志愿者维护。 Javascript 是 Facebook 的主要前端语言,也由 Facebook 维护。
我是一名 PHP 开发人员,从事 Facebook 应用程序已经有几年了。我最近转而主要使用 javascript 而不是 PHP。就我个人而言,我认为 javascript 对于相同的功能提供了更好的用户体验。 PHP 和任何后端语言都需要重定向来完成大多数事情。 Javascript 都是内联的。
此外,由于您直接包含来自 Facebook 服务器的 javascript 库,因此它们会自动更新代码。他们总是在改变 API 和规则。必须不断更新后端库并调整代码确实很痛苦。
如果您愿意,可以使用我为 someecards.com Facebook 应用程序创建的代码来帮助您入门。我有一个独立的 javascript 文件,可以处理大部分病毒式传播功能(即墙贴、请求)。它相当通用,因此可以在任何应用程序中重复使用。
PHP is the only officially supported backend language, Facebook maintains the library. All other backend languages are maintained mainly by volunteers. Javascript is Facebook's primary front-end language, also maintained by Facebook.
I'm a PHP developer, and have been doing Facebook apps for a few years now. I recently switched to using mainly javascript over PHP. Personally, I think javascript presents a much better user experience for the same functionality. PHP, and any backend language, requires redirects to accomplish most things. Javascript is all inline.
Also, since you include the javascript libs directly from Facebook's servers, they automatically update the code. They are always changing the API, and the rules. It's a real pain to have to constantly be updating your backend libs and adjusting your code.
If you like, you can use the code I created for the someecards.com Facebook app to get you started. I have a standalone javascript file that handles most of the viral functionality (i.e. wall posts, requests). Its fairly generic, so could be reused in any app.