var templateLink = envVars.rootTemplateFolder + $(this).attr('link');
console.log("templateLink : ", templateLink);
$.ajax({
method: "GET",
url: templateLink,
context: this,
success : function(result){
var theHtml = result.toString();
$(this).replaceWith(theHtml);
}
templateLink should = "resources/spa/templates/header.html" and according to the console log it is.
BUT I am always getting a 404 on "resources/spa/resources/spa/templates/header.html"
I can take out the variable and just pass the basic string "resources/spa/templates/header.html" And, I still get the duplicate.
If just leave it as "/templates/header.html", then it will not repeat the "resources/spa", of course, the rest of the string is not there now. So this indicates that the object being passed to the AJAX call is getting parsed and changed.
How to I stop this? I'm confused as to why it is acting this way.
Any ideas?