SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
-
Jun 28, 2006, 02:38 #1
- Join Date
- Nov 2005
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
i need a simple script, do u have one?
hey
i need a script that would display new peace of text every time the page loads. i dont know how can i do that but all i want to do is put a block on my page and display new peace of text at every pageload. like, random pictures or sth like the great words or sth,(i had seen such things on websites).
i will prepare 100 peaces of text and want my first visitor see the text #1 and 88th see #1 but 101st visitor will see #1 again.
would any of you who knows this kindof stuff tell me how can i do this, give a tutorial, script or i donno, sth that will enable me to do this
thankshello everyone!
-
Jun 28, 2006, 02:51 #2
- Join Date
- Sep 2005
- Location
- Sydney, NSW, Australia
- Posts
- 16,875
- Mentioned
- 25 Post(s)
- Tagged
- 1 Thread(s)
I have instructions on how to create such code at http://javascript.about.com/library/blrand.htm
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
-
Jun 28, 2006, 03:45 #3
- Join Date
- Nov 2005
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
thank you,
it is nice simple and useful script but it displays random, cant i get one displaying in ordered way?hello everyone!
-
Jun 28, 2006, 10:04 #4
- Join Date
- Jul 2003
- Location
- Kent
- Posts
- 1,921
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
How will the javascript keep count of the visitor number????
Javascript is executed client side when the page loads. So a random bit of text is the best you can do. How will visitor two know or even care that they are seeing a different bit of text to visitors one and three?Dr John
www.kidneydialysis.org.uk
-
Jun 29, 2006, 04:54 #5
- Join Date
- Nov 2005
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
mr john,
i do not know, i asked if that is possible to help me out with that.
one thing i forgot was that javascript works server side and does not ave database to keep count of number or visitors, you were right.
thank you all for your helphello everyone!
Bookmarks