Hi,
What I did:
- create new ACL
- create (mirror) all resources required by new template
- created new template
- copied existing template's code to new template - ALL INLINE JS FOR TEMPLATE NOT CHANGED
- pointed all new resources at new template
- pointed all new resources to new resource group
- added a user (me) to the new resource group and logged in as that user
- at the suggestion someone on these forums, I added <base href="
https://abc.com/"/> to the head section of the
NEW template
.... at this point I can see the new resources and am using the new template
Issue: ANY inline JS (jquery) $.post(...) present in the copied template fails with 404. Original template's $.post calls work as expected. $.post's look like:
$.post('
MODX_AJAX_RESOURCE', params, function(msg){
var result = JSON.parse(msg);
if (result.error != undefined){
alert('error');
} else {
window.location.reload();
}
}).fail(function(XMLHttpRequest, textStatus, errorThrown){alert('failed save');
});
});
The "fail"'s args are set to:
XMLHttpRequest.status: 404
textStatus: "error"
errorThrown: "Not Found"
- Original template ajax calls work AS EXPECTED.
- AJAX resource was not changed.
- Snippet endpoints were not changed.
- The fully-qualified path looks valid.
What needs to happen for the new template's inline JS calls to see the existing ajax resource/snippet endpoints?
Please help, I do not what else to look for.
James
[ed. note: jxarms3 last edited this post 5 years, 8 months ago.]