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


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: