0

I need to reload the data within a DIV, I am using a time stamp for testing purposes.

The code I have appears to work outside of Magento So I cannot see why it is not working on my Magento Site.

I am trying to achieve this using jQuery using the following:

jQuery(document).ready(function(){
  setInterval(function(){
    jQuery('#bopa').load();
  },3000);
});

The HTML is:

<div id="bopa">
<?php $datee = new DateTime(); echo $datee->format('H:i:s') . "\n";?>
</div>

Does anyone know why this isn't working?

2
  • are you getting any js errors in console? use F12 to check
    – Robin
    Aug 16, 2016 at 13:43
  • No errors in console Aug 16, 2016 at 14:15

1 Answer 1

0

your snippet will not working with native php. according to jQuery official Document you need to put first argument as same page as Object type(string url).

3
  • I have changed the code as I believe that $ conflicts with Magento Prototype. Aug 16, 2016 at 13:17
  • did your console show you a ajax request ?
    – user27155
    Aug 16, 2016 at 13:22
  • nothing is in console. Aug 16, 2016 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.