I use wordpress and I wanted to ask, is there a way to use the TEMPLATEPATH in my JS.
Like this:
jQuery ("#ajax").load ("<?php echo TEMPLATEPATH;?>" + "/aaa.txt");
The problem is the result of TEMPLATEPATH is C:\XAMPP\HTDOCS … And therefore i have browser error: Cross origin requests are only supported for HTTP.
There isn’t a great deal of information provided. Are you using WordPress on
localhost? With afile://protocol?Anyway, try replacing
TEMPLATEPATHwithget_template_directory_uri().