Jump to content

[SOLVED] PEAR::HTML_AJAX component refresh


fj1200
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.