Rifts Posted July 13, 2010 Share Posted July 13, 2010 Hey everyone I've searched and could not find a php script (or even javascript) that will change text on my site every X amount of seconds. I can only find script that will change once refreshed. can anyone help me out? Thanks Link to comment https://forums.phpfreaks.com/topic/207624-php-script-to-change-text-without-refreshing/ Share on other sites More sharing options...
dyluck Posted July 13, 2010 Share Posted July 13, 2010 Just doing a quick search on google found that you should be looking at the AJAX side of things to do this. Link to comment https://forums.phpfreaks.com/topic/207624-php-script-to-change-text-without-refreshing/#findComment-1085531 Share on other sites More sharing options...
Rifts Posted July 14, 2010 Author Share Posted July 14, 2010 I know nothing about Ajax Link to comment https://forums.phpfreaks.com/topic/207624-php-script-to-change-text-without-refreshing/#findComment-1085614 Share on other sites More sharing options...
Alex Posted July 14, 2010 Share Posted July 14, 2010 I know nothing about Ajax Well then it's a good thing there is so much information available about it online, isn't it? Link to comment https://forums.phpfreaks.com/topic/207624-php-script-to-change-text-without-refreshing/#findComment-1085694 Share on other sites More sharing options...
Rifts Posted July 14, 2010 Author Share Posted July 14, 2010 OK well I found something is that kind of close to what im looking for and I was wondering if anyone could help.. this is what I found <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <script type="text/javascript"> var clientData = new Array(); clientData[1] = "This is Data for Client 1"; clientData[2] = "This is Data for Client 2"; clientData[3] = "This is Data for Client 3"; clientData[4] = "This is Data for Client 4"; clientData[5] = "This is Data for Client 5"; clientData[6] = "This is Data for Client 6"; clientData[7] = "This is Data for Client 7"; var clientId function swapText(clientId) { document.getElementById("clientInfo").innerHTML = clientData[clientId]; } </script> </head> <body> <table width="100%"> <tr> <td colspan="2" align="center">CLIENTS</td> </tr> <tr> <td> <a href="javascript: swapText(1);">Client 1</a><br /> <a href="javascript: swapText(2);">Client 2</a><br /> <a href="javascript: swapText(3);">Client 3</a><br /> <a href="javascript: swapText(4);">Client 4</a><br /> <a href="javascript: swapText(5);">Client 5</a><br /> <a href="javascript: swapText(6);">Client 6</a><br /> <a href="javascript: swapText(7);">Client 7</a><br /> </td> <td> <span id="clientInfo">Click on a Client for Information.</span> </td> </tr> </table> </body> </html> but I need it to switch every X amount of seconds instead of when you click thanks Link to comment https://forums.phpfreaks.com/topic/207624-php-script-to-change-text-without-refreshing/#findComment-1086024 Share on other sites More sharing options...
Vince889 Posted July 15, 2010 Share Posted July 15, 2010 You can use jQuery for that. Link to comment https://forums.phpfreaks.com/topic/207624-php-script-to-change-text-without-refreshing/#findComment-1086204 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.