want to add absolute url by wp_enqueue_script() in wordpress

Hi all I want to add absolute url of scripts to wordpress. I’m using wp_enqueue_script();

But it always add my own domain to script’s url. I’m adding url like

//maps.googleapis.com/maps/api/js?key=SyBjVX7N2HGlLg-ygAEy9VUCzn6zPkU2XM0&libraries=places&language=en

in browser I always got like

/wp-content/plugins/plugname/assets/js/https://maps.googleapis.com/maps/api/js?key=SyBjVX7N2HGlLg-ygAEy9VUCzn6zPkU2XM0&libraries=places&language=en

Don’t now how to remove /wp-content/plugins/plugname/assets/js/

Read more here: want to add absolute url by wp_enqueue_script() in wordpress

Leave a Reply

Your email address will not be published. Required fields are marked *