Jump to content

random text


CyberShot

Recommended Posts

I am not sure what category to put this in, so I am putting it here. I am trying to make a random quotes generator. It works. But not in I.E. Here is the test site

 

http://www.iwdstudios.com/random/

 

can anyone offer a suggestion.

 

<?php
class quotes
{
function quotes() {

	switch(intval(rand(1,5)))
	{

		case 1:
			$this->quote = "A computer once beat me at chess, but it was no match for me at kick boxing 
-Emo Philips" ;
			break;
		case 2:
			$this->quote = "It was when I found out I could make mistakes that I knew I was on to something -Ornette Coleman" ;
			break;
		case 3:
			$this->quote = "You can't build a reputation on what you're going to do -Henry Ford";
			break;
		case 4:
			$this->quote = "People are just as happy as they make up their minds to be -Abraham Linkcoln";
			break;
		case 5:
			$this->quote = "Good advice is something a man gives when he is too old to set a bad example -Francois de La Rochefoucauld ";
			break;

	}
}
}

		$quotes = new quotes();
		echo $quotes->quote;

?>

Link to comment
https://forums.phpfreaks.com/topic/184189-random-text/
Share on other sites

and your javascript code is very messy

hard to read!!!

 

What? You find this difficult to read?

function getRandom() {
$("#random").hide();
$("#random").load("quotes.php", '', callback);
}

function callback() {
$("#random").show("slow");
setTimeout("getRandom();", 10000);

}

$(document).ready(getRandom);

Link to comment
https://forums.phpfreaks.com/topic/184189-random-text/#findComment-972499
Share on other sites

I don't think it is a problem with the jquery. The code works as intended in

 

firefox

opera

google chrome

saffari

 

The only browser I can't get it to work in is I.E 8. It just blinks. the message never changes. Just blinks every few seconds. That shows that the jquery is doing what it is suppose to. I was hoping someone might now what the issue is. If you think it's the jquery, offer up a sollution.

Link to comment
https://forums.phpfreaks.com/topic/184189-random-text/#findComment-972532
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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