I have script to refresh div. In this script loaded file test.php and display on div # welcome-desc in normal code this script is work, but not joomla. I need refresh selected one dive to all pages. Address to test.php is correct. The script JS works correctly but not work content to Joomla (3.X ) (custom html module ) What am I doing wrong ?
<script>
$(function(){
setInterval(function(){
$("#welcome-desc") .load("dc/test.txt");
}, 3000);
});
</script>
Custom html module may filter the contents of your script and not let them display properly.
First option (recommended) is to create a simple hello_world module using this tutorial and implement your js code via addScriptDeclaration().
Second option is to get a ready made module for custom code in modules from this list.
Hope this helps
Firstly, you should ensure you script is in noConflict mode as this is how Joomla imports jQuery. Secondly, I'm not sure where you're adding this script but you should define the root of your site when calling a file. Thirdly, I would suggest using Joomla API to inject your script into the
<head>
. Like so:I would also suggest you check your browser console for any errors