Load javascript within a google map info window HTML content
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/
精彩评论