Page 1 of 1

Tablename-dv.js

Posted: 2023-10-06 00:41
by dannybridi
Hi,

I have for many year used the following code in the tablename-dv.js in the hooks folder to add separators after some fields in my details view:
$j(‘#Field1’).parents(‘.form-group’).after(‘<hr><hr>’);
$j(‘#Field2’).parents(‘.form-group’).after(‘<hr><hr>’);
$j(‘#Field3’).parents(‘.form-group’).after(‘<hr><hr>’);
$j(‘#Field4’).parents(‘.form-group’).after(‘<hr><hr>’);
I now need to change the position of some of the separators because I added some fields, but any changes I make are not reflected. If I, however, delete (or rename) the file, all separators disappear (as expected). Even if I comment all lines in the file the separators remain. Strange behavior — at least to me.

Has anyone else encountered this behavior?

Thanks

Re: Tablename-dv.js

Posted: 2023-10-06 10:19
by jsetzer
but any changes I make are not reflected
Perhaps a caching issue?

Clear browser cache before reloading the page. This should force the browser to load the javascript file from the server and not from (local) cache.

Re: Tablename-dv.js

Posted: 2023-10-07 18:41
by dannybridi
Well, I swear to you I tried that already, but after reading your reply I tried it again, and guess what, it's working now :!: I guess it was a caching issue.
Thank you for replying.

Re: Tablename-dv.js

Posted: 2023-10-07 20:54
by jsetzer
Great, happy to hear.

Don't worry, very often, reported 'bugs' figure out as caching problems. I've already asked Ahmed for adding a version tag to all script-includes a while ago, for example...

Code: Select all

<script src=".....js?v=...."></script>
This would solve many problems for many developers. Hopefully this will be part of some future version.

When coding js (or css) I got used to reloading the browser without cache EVERY time I reload. Fortunately there are keyboard shortcuts. Once you got used to it, this is not a problem any longer.