Cross Domain Issue with implementing Google URL shortener API

后端 未结 3 752
我在风中等你
我在风中等你 2021-01-03 02:23

I am trying to implement the Google URL shortener API with the help of jQuery by making an AJAX call. I have done something like this:

$(function() {
    $(         


        
3条回答
  •  温柔的废话
    2021-01-03 03:00

    You can use a dynamic script tag to make cross domain ajax calls. As pointed here this method has some problems: It's difficult to know when the content is available, there is no standard methodology, and can be considered a "security risk".

    However the method works fine in my case. refer to here for a good example. The approach is a bit tricky.

提交回复
热议问题