开发者

Load javascript within a google map info window HTML content

开发者 https://www.devze.com 2023-03-22 21:10 出处:网络
I would like to load a javascript script within a google map info window HTML content but,开发者_Python百科 for reasons I don\'t understand, the script is not loaded.

I would like to load a javascript script within a google map info window HTML content but,开发者_Python百科 for reasons I don't understand, the script is not loaded.

I generate my infowindow like that :

var info_window = new google.maps.InfoWindow({"content":"<script type=\"text\/javascript\" src=\"\/path\/to\/js\"><\/script>"});

I precise that the javascript path has been tested.

Is it possible to load javascript script like that? If yes, what's wrong ?


Are you using jQuery?

If so, you could add the script anywhere else in the document besides the infowindow and use .ajaxComplete() to target some script to the infowindow after the ajax call has finished.

http://api.jquery.com/ajaxComplete/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号