简体   繁体   中英

WordPress not recognizing simple Javascript file

Okay, so I've uploaded this super simple HTML page here:

http://medicaldevicesgroup.net/wp-content/themes/medicaldevicesgroup/test.html

It's utilizing LinkedIn's "Sign In" API. View the source. It's two lines of code. Nothing.

BUT

I created a home.php file in my child theme directory, and pasted this:

<?php require(CHILD_DIR.'/test.html'); ?>

This means that if you view the source at http://www.medicaldevicesgroup.net/ , it's EXACTLY the same as the source at http://medicaldevicesgroup.net/wp-content/themes/medicaldevicesgroup/test.html . The only difference is that the home page is in WordPress, and the other URL isn't.

The home page script, however, doesn't work. WHY???? Help! Thanks.

The reason is because the LinkedIn API that you are using is for http://medicaldevicesgroup.net and not http://www.medicaldevicesgroup.net . Notice the "www" in 2nd URL. You need to change your URL in the LinkedIn API.

To see what I mean try going to http://www.medicaldevicesgroup.net/wp-content/themes/medicaldevicesgroup/test.html and it will not work there too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM