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