File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed
src/resources/views/crud/fields Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change 163163 url: null
164164 };
165165
166- $ .getJSON (api, function ( data ){
167-
168- if (typeof (data .items [0 ]) != " undefined" ) {
169- var v = data .items [0 ].snippet ;
170-
171- video .id = videoId;
172- video .title = v .title ;
173- video .image = v .thumbnails .maxres ? v .thumbnails .maxres .url : v .thumbnails .default .url ;
174- video .url = ' https://www.youtube.com/watch?v=' + video .id ;
175-
176- callback (video);
166+ $ .ajax ({
167+ dataType: " jsonp" ,
168+ url: api,
169+ crossDomain: true ,
170+ success : function (data ) {
171+ if (typeof (data .items [0 ]) != " undefined" ) {
172+ var v = data .items [0 ].snippet ;
173+
174+ video .id = videoId;
175+ video .title = v .title ;
176+ video .image = v .thumbnails .maxres ? v .thumbnails .maxres .url : v .thumbnails .default .url ;
177+ video .url = ' https://www.youtube.com/watch?v=' + video .id ;
178+
179+ callback (video);
180+ }
177181 }
178182 });
179183 };
You can’t perform that action at this time.
0 commit comments