Search code examples
jqueryhtmlajaxjquery-loadjquery-get

append html file to another html file using jquery locally


I have tried to append a html file into a html file using the $.get method as well as $.ajax and .load methods. the actual issue is that the file does not append yet works when opened alone. could it be that the site is running from the computer and not a server? or is there something that needs to be declared in either the html files.


Solution

  • In Chrome it will not work until you upload it to the server or use a local server.
    I like XAMPP

    Open google chrome through cmd prompt with cmd:
    chrome.exe --allow-file-access-from-files
    (P.S: untested.)