CyberShot Posted December 6, 2009 Share Posted December 6, 2009 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; ?> Quote Link to comment https://forums.phpfreaks.com/topic/184189-random-text/ Share on other sites More sharing options...
greatstar00 Posted December 6, 2009 Share Posted December 6, 2009 on ie, when i open it as in a new windows, it works but when i just refresh it in the same window, it doesnt work so, show us the javascript Quote Link to comment https://forums.phpfreaks.com/topic/184189-random-text/#findComment-972484 Share on other sites More sharing options...
Andy-H Posted December 6, 2009 Share Posted December 6, 2009 Thats a problem with your AJAX (or jQuery) code, not the PHP... Quote Link to comment https://forums.phpfreaks.com/topic/184189-random-text/#findComment-972488 Share on other sites More sharing options...
greatstar00 Posted December 6, 2009 Share Posted December 6, 2009 and your javascript code is very messy hard to read!!! Quote Link to comment https://forums.phpfreaks.com/topic/184189-random-text/#findComment-972497 Share on other sites More sharing options...
Daniel0 Posted December 6, 2009 Share Posted December 6, 2009 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); Quote Link to comment https://forums.phpfreaks.com/topic/184189-random-text/#findComment-972499 Share on other sites More sharing options...
CyberShot Posted December 6, 2009 Author Share Posted December 6, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/184189-random-text/#findComment-972532 Share on other sites More sharing options...
oni-kun Posted December 6, 2009 Share Posted December 6, 2009 I'd recommend downloading an older version of jQuery, No loss and it may fix your problem. I've not seen this problem happening, and my (old) IE 6.0 works fine with it. Quote Link to comment https://forums.phpfreaks.com/topic/184189-random-text/#findComment-972536 Share on other sites More sharing options...
CyberShot Posted December 6, 2009 Author Share Posted December 6, 2009 well, I used I.E tester to check that and it does not work. it just keeps repeating the same one over and over Quote Link to comment https://forums.phpfreaks.com/topic/184189-random-text/#findComment-972540 Share on other sites More sharing options...
Daniel0 Posted December 6, 2009 Share Posted December 6, 2009 Could it be a caching issue? Quote Link to comment https://forums.phpfreaks.com/topic/184189-random-text/#findComment-972547 Share on other sites More sharing options...
CyberShot Posted December 6, 2009 Author Share Posted December 6, 2009 I don't know. I am testing online again and it is working with no changes. I am wondering if it is buggy Quote Link to comment https://forums.phpfreaks.com/topic/184189-random-text/#findComment-972548 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.