简体   繁体   中英

Link and include script

I have this page with a include script that is:

<script> 
    $(function(){
        $("#header").load("header.html"); 
    });
</script> 

It works perfectly on my computer but on the webserver it stops working, I've tried header.html , ./header.html and //header.html . Other links, for images for exemple, work perfectly. Help?

Try Giving the absolute path for the "header.html" file. For Ex - "C:/users/wamp/html/header.html"

Examining your website, you have an error in your JQuery which prevents your JQuery code from working . Fix the following issues:

在此处输入图片说明

After that, Try loading your HTML file with a full path starting from the root directory :

$("#header").load("/foldername/header.html");

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