External Javascript Not Working?
-
Hello
Attempting to integrate a booking widget into a clients website. Site is running the latest WordPress 5.2.2 with HTTPS.
I apologise for being a bit “vague” in this topic however due to client confidentiality I cannot disclose the URL or name of the website in question. Hopefully someone can still point me in the right direction!
The company that handles this booking widget provides two lots of code for integration into your own website. The first is an external JavaScript file that has to go in either header.php or footer.php , then the second lot of code is specific to the particular event you want the booking widget for.
I have put the following into a static basic HTML page and it works without an issue.
<html> <head> <title>Test Page</title> <script type="text/javascript" src="<External JS File>"></script> </head> <body> <a rel="widget" target="_top" style="display: block; margin: 25px auto; text-align: center" href="<LINK TO EVENT>"></a> </body> </html>
I have added the external JavaScript to header.php, footer.php and also in-line on the same page and I can see that it is being correctly loaded using Google Chromes Developer Tools, however I just get a blank space where the second lot of code is entered on the page.
This is on a “blank” WordPress 5.2.2 installation, tried both HTTP and HTTPS (all my clients sites are HTTPS) , using the stock Twenty Nineteen theme (I also tried Twenty Sixteen , no difference). No plugins or caching etc. are in use on the development site I am testing this with.
Does anybody have any advice? I have also tried 3rd party plugins such as “Insert Headers & Footers” to handle the insertion of the JavaScript code however this didn’t make a difference.
I look forward to hearing any advice and suggestions!
- The topic ‘External Javascript Not Working?’ is closed to new replies.