搜索 api 用于外部网站 [英] search api to use in external websites
问题描述
我是api开发新手,不知道这个可行不可行.
I am new to api development, so don't know whether this is feasible or not.
我有一个由数据组成的网站(http://www.mysite.com/
),我需要开发一个 api 或以某种方式使用该网站的数据在其他网站中使用它.
I have a website(http://www.mysite.com/
) which consists of data and i need to develop an api or somehow use this site's data to use it in another websites.
我的要求是其他外部网站(http://www.externalwebsites.com
)需要从我的主网站(http://www.mysite.com/
).http://www.externalwebsites.com/
将搜索字符串发送到 http://www.mysite.com/
并将返回结果并在 <代码>http://www.externalwebsites.com/.
My requirement is other external websites(http://www.externalwebsites.com
) need to search the data from my main site (http://www.mysite.com/
). http://www.externalwebsites.com/
will send search string to http://www.mysite.com/
and it will send back result and show them in http://www.externalwebsites.com/
.
我需要在 http://www.externalwebsites.com/
中使用 ajax 调用来搜索数据,所以我的问题是
i need to use ajax calls in http://www.externalwebsites.com/
for searching data, so my question is
- 这整个过程可行吗?
推荐答案
当然,您可以使用 JSONP,jQuery 等库默认支持.
Sure, you can use JSONP, supported by default in libraries like jQuery.
http://docs.jquery.com/发布:jQuery_1.2/Ajax#Cross-Domain_getJSON_.28using_JSONP.29
这篇关于搜索 api 用于外部网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!