patrik-herman / dynamic-linking

A small JS/jQuery app which you can dynamically load pages with.
2 stars 0 forks source link

Remove .html extension #1

Open VeeeneX opened 9 years ago

VeeeneX commented 9 years ago

The problem is in def.website = decode_url_by_hash + ".html";, modern pages usually doesn't have .html extension.

if(decode_url_by_hash != loc){
    def.website = decode_url_by_hash + ".html";
    def.websiteHeadline = websites_headline_names[def.website];
}
patrik-herman commented 9 years ago

Nice post! Will be in update!

VeeeneX commented 9 years ago

var decode_url_by_hash = loc.split("#")[loc.split("#").length-1]; Should be replaced with: var hash = window.location.hash;