[英]Making request in server, Samsung smart tv app?
我将开发一个三星智能电视应用程序,但是我不知道如何在服务器数据库中发出请求,因为三星智能电视仅支持Javascript。
With javascript only you will not be able to do that. 仅使用javascript,您将无法做到这一点。
You will need: 你会需要:
$.ajax({ url: 'samsungdata.php', success: function(data) { alert('Load was performed.'); } });
You can't access the database directly. 您不能直接访问数据库。 You need to create a web service.
您需要创建一个Web服务。 Your server will accept HTTP requests, run a piece of software (eg written in Perl or PHP) and return the data in the response.
您的服务器将接受HTTP请求,运行一个软件(例如,用Perl或PHP编写),然后在响应中返回数据。
Samsung provides an implementation of XMLHttpRequest. 三星提供了XMLHttpRequest的实现。 You can use this to cause the device to make the HTTP requests.
您可以使用它来使设备发出HTTP请求。
They have an example of how to use it in their SDK documentation . 他们在SDK文档中提供了有关如何使用它的示例 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.