Jump to content

php script to change text without refreshing?


Rifts

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.

×
×
  • 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.