fj1200 Posted December 11, 2008 Share Posted December 11, 2008 I'm going to to be replacing the iframes on a php production dashboard with an ajax-driven page using the PEAR HTML_AJAX module but as yet there's no end-user documentation, and hunting the web - and this site - has not really revealed much. I'm fairly new to PEAR, and have done very little JS but recently had my eyes opened to what AJAX could do for us. The iframes show graphs and datagrids driven by PEAR modules. Just recently 'discovered' AJAX, but how do I get the individual components to refresh? They point to different databases, some refresh once a minute, others I want to do once a day or once a week. Sorry if it sounds a bit thick, but I've been looking for ages. Quote Link to comment https://forums.phpfreaks.com/topic/136498-solved-pearhtml_ajax-component-refresh/ Share on other sites More sharing options...
fj1200 Posted December 15, 2008 Author Share Posted December 15, 2008 81 views an nobody can help? Right - well, spent a few frustrating days digging around - can anyone tell me why this produced a page of garbage when it should be a .png image of a graph? (btw - the timer bit works fine now) <html> <head> <script type="text/javascript" src="../Includes/server.php?client=all"></script> <div id="target"></div> <script type="text/javascript"> function graph() { HTML_AJAX.replace('target','../graphs/graph_stacked_rs.php'); } function refreshpage() { setInterval(graph(), 10000); } </script> </head> <body onload = "refreshpage();"> </body> </html> It produces this: �PNG IHDR,�E��XIDATx���P���/�i�\*"���1�Wcp4s� G���Z��q��V{�r֩��8t���ǐZf��D�0ۨe)R�)���m�� ��$߄�_=99����_�r��큁����ݻw?y���ӓ������9_����,[���bŊ������gϞ������:H�Z�����J���o�]�h����u/& ��߿����y��尰0�B�q��˗�̦���۷O9v�X@@���K@@�'�v�����P��kמ;wΜ���'''�>}J�t钓�ӡC�<==�,Yr��=�}��{��]�z���ˢE��l���c��o߾��흞 Should I be formatting it and saving it as a php page? But if all it's importing is a .png from a PEAR IMAGE_GRAPH module (which works really well on normal php pages) I don't see why it should need to be in php format. Or am I wrong there.... Can anyone help please? Quote Link to comment https://forums.phpfreaks.com/topic/136498-solved-pearhtml_ajax-component-refresh/#findComment-715870 Share on other sites More sharing options...
fj1200 Posted December 17, 2008 Author Share Posted December 17, 2008 Solved on another forum. FYI - needs an <img> tag not a <div> Quote Link to comment https://forums.phpfreaks.com/topic/136498-solved-pearhtml_ajax-component-refresh/#findComment-717483 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.