Forum for discussing general topics related to Couch.
8 posts Page 1 of 1
Gentlemen, I was wondering if you could kindly advise here:

It is related to my previous query at viewtopic.php?f=4&t=11209 - site running a phpmailer (which I will soon showcase). It entails a a javascript (<script src="<cms:show k_site_link />form/js/jform.js"></script>), which contains a reference to another script (url : '/form/mailer/owner.php'). With the pretty URLs activated, this link within the .js seems to lose its target.

Now, in the previous post I was able to fix it either by using an absolute URL for that php script of by redefining the root and rewritebase. This time, however, I am not able to kill the cache, or so it seems when trying to use the full URL for the php file. I have tried disabling the cache, posting new dummy content (to invalidate cache?), played with the K_CACHE_PURGE_INTERVAL, checked the .js file permissions (currently set to 666, ), working in an incognito mode, logged in as superadmin, tried different PC - no success, although the changes have been properly saved in multiple ways, if browsing to winkcake.cz/form/js/script.js, I still see the relative address 'form/mailer/owner.php', which is obviously not working with pretty URLs on.

The question thus being, what am I missing, please? Is there any neat way to purge cache in such cases, or do I need to wait some time for the changes to come into effect?

Edit: what works is that I save a copy of the .js (such as /form/js/script2.js) and change links in my templates to this new file. It does do the trick ... nevertheless, I am still struggling about these ex post markup changes and updates...
Setting aside possible digging and looking for a solution, I suggest to go the other way. Make linked JS file manageable by Couch. It would be then possible to use couch tags in it, which would help establish correct url all the time.
Thanks, trendoman ... but how exactly do I make a .js manageable by the couch? By adding the usual boilerplates? Does it not need to be a .php file then? Or do you mean having the javascript directly in the template file?

Being able to change variables in linked .js files from admin would indeed open an array of new possibilities...
but how exactly do I make a .js manageable by the couch? By adding the usual boilerplates? Does it not need to be a .php file then?

Yes. Search forum :)
Mmmhm, yes, that is the way to make a lazy man explore and learn by trying. :D Nevertheless, could you please hint as to which of the above options it is, please? I certainly could couchified an online is, but a linked one? Spent some time now browsing the forum with no definite result ..
Sorry, I was busy with something. Everything takes precious time, especially for lazy people like me. :)
Here you go viewtopic.php?f=4&t=8692#p16883
Yeah, trendoman, I thought it would be something like that, thanks a lot!

This is a bloody awesome system indeed.

// As to complement my original question above, the persistent (cached) javascript was indeed only a matter of time - when I checked the same today, the link to the php script was successfully changed. But I will definitely utilize that couchified js stuff.
You are welcome :) Thanks for the donation :D
8 posts Page 1 of 1