SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Guru tombempty's Avatar
    Join Date
    Oct 2001
    Location
    New York
    Posts
    688
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Red face A javascripting guru is what i need.

    Hi all:
    I created this site at exitrealtyrsvp and underneath the pic, I set this javascript for a random text.

    Long story short......there is no text at all. I inserted this code at 83 :
    <strong><em>&quot;TO GET YOU WHAT YOU WANT <br>
    IN THE TIME THAT YOU WANT IT.</em></strong></font><em><strong>&quot;</strong></em></p>
    <p align="center">
    <script language="JavaScript" type="text/JavaScript">
    <SCRIPT LANGUAGE="JAVASCRIPT">
    <!-
    var r_text = new Array ();
    r_text[0] = "All the leaves are brown";
    r_text[1] = "And the sky is grey";
    r_text[2] = "I've been for a walk";
    r_text[3] = "On a winter's day";
    r_text[4] = "I'd be safe and warm";
    r_text[5] = "If I was in L.A.";
    r_text[6] = "California dreaming, On such a winter's day";
    var i = Math.round(6*Math.random());

    document.write(r_text[i]);

    ->
    </script>
    </p>

    am I to put anything in the <head> of the document too cause all I got is this in the body tag. Let me know someone pleaaaaaaaaaaaase. thanks
    ********
    Regards,

    P

  2. #2
    SitePoint Evangelist Mr. Brownstone's Avatar
    Join Date
    May 2002
    Location
    Relative
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <html>
    
    <head>
    
    	<title>California Dreaming</title>
    
    	<script language="JavaScript">
    
    		function mamas_and_papas ( ) {
    			var r_text = new Array (
    				'All the leaves are brown',
    				'And the sky is grey',
    				'I\\'ve been for a walk',
    				'On a winters day',
    				'I\\'d be safe and warm',
    				'If I was in L.A.',
    				'California dreaming, on such a winters day'
    			);
    
    			var array_length = r_text.length - 1;
    			var random_index = Math.round ( array_length * Math.random ( ) );
    
    			return ( r_text [ random_index ] );
    		}
    
    	</script>
    
    </head>
    
    <body>
    
    	Ooh, ooh, oooooh, the funky gibbon... <br /><br />
    
    	<script language="JavaScript">
    		document.write ( mamas_and_papas ( ) );
    	</script>
    
    </body>
    
    </html>
    Looks pretty much the same as what you’ve got. I hope you can glean the “new stuff” from it easily enough.
    Last edited by Mr. Brownstone; Jan 26, 2003 at 20:08.
    Of course, that's just my opinion. I could be wrong.

  3. #3
    SitePoint Guru tombempty's Avatar
    Join Date
    Oct 2001
    Location
    New York
    Posts
    688
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking Can Brown do this....

    Thanks mr. Brown but, If you look at the link and the code I inserted where you told me too it still did not show. here is the code I put in the head:

    <title>Welcome to Exit Realty RSVP!</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script language="JavaScript">
    <!--

    function mmLoadMenus() {
    if (window.mm_menu_0123223141_0) return;
    window.mm_menu_0123223141_0 = new Menu("root",110,20,"Arial, Helvetica, sans-serif",16,"#000000","#ffffff","#cccccc","#000084","center","middle",2,0,1000,-5,7,true,true,true,0,true,true);
    mm_menu_0123223141_0.addMenuItem("Our&nbsp;Agents","location='http://www.exitrealtyrsvp.com/age.htm'");
    mm_menu_0123223141_0.addMenuItem("Our&nbsp;Staff","location='http://www.exitrealtyrsvp.com/staff.htm'");
    mm_menu_0123223141_0.addMenuItem("Join&nbsp;Our&nbsp;Team","location='http://www.exitrealtyrsvp.com/join.htm'");
    mm_menu_0123223141_0.hideOnMouseOut=true;
    mm_menu_0123223141_0.menuBorder=1;
    mm_menu_0123223141_0.menuLiteBgColor='#ffffff';
    mm_menu_0123223141_0.menuBorderBgColor='#555555';
    mm_menu_0123223141_0.bgColor='#555555';
    window.mm_menu_0118153407_0 = new Menu("root",61,20,"Arial, Helvetica, sans-serif",16,"#000000","#ffffff","#cccccc","#000084","center","middle",2,0,1000,-5,7,true,true,true,0,true,true);
    mm_menu_0118153407_0.addMenuItem("Nassau","location='http://www.exitrealtyrsvp.com/nass.htm'");
    mm_menu_0118153407_0.addMenuItem("Suffolk","location='http://www.exitrealtyrsvp.com/suff.htm'");
    mm_menu_0118153407_0.hideOnMouseOut=true;
    mm_menu_0118153407_0.menuBorder=1;
    mm_menu_0118153407_0.menuLiteBgColor='#ffffff';
    mm_menu_0118153407_0.menuBorderBgColor='#555555';
    mm_menu_0118153407_0.bgColor='#555555';
    window.mm_menu_0118153407_1 = new Menu("root",140,18,"Arial, Helvetica, sans-serif",14,"#000000","#ffffff","#cccccc","#000084","left","middle",2,0,1000,-5,7,true,true,true,0,true,true);
    mm_menu_0118153407_1.addMenuItem("Mission&nbsp;Statement","location='http://www.exitrealtyrsvp.com/miss.htm'");
    mm_menu_0118153407_1.addMenuItem("How&nbsp;we&nbsp;can&nbsp;help&nbsp;you","location='http://www.exitrealtyrsvp.com/form.html'");
    mm_menu_0118153407_1.addMenuItem("Location","location='http://www.exitrealtyrsvp.com/loc.htm'");
    mm_menu_0118153407_1.addMenuItem("Contact&nbsp;Us","location='http://www.exitrealtyrsvp.com/contc.htm'");
    mm_menu_0118153407_1.hideOnMouseOut=true;
    mm_menu_0118153407_1.menuBorder=1;
    mm_menu_0118153407_1.menuLiteBgColor='#ffffff';
    mm_menu_0118153407_1.menuBorderBgColor='#555555';
    mm_menu_0118153407_1.bgColor='#000000';

    mm_menu_0118153407_1.writeMenus();
    }

    // mmLoadMenus()
    //-->

    <script language="JavaScript" type="text/JavaScript">
    <SCRIPT LANGUAGE="JAVASCRIPT">
    function quotes( ) {
    var r_text = new Array (
    "Happy is the man who has broken the chains which hurt the mind,
    and has given up worrying once and for all. - Ovid",
    "Keep away from people who try to belittle your ambitions. Small people always do that
    but the really great make you feel that you, too, can become great! - Mark Twain",
    "Become a possibilitarian.No matter how dark things seem to be or actually are
    raise your sights and see the possibilities– always see them, for they’re always there. - Norman Vincent Peale",
    "The sincerest satisfactions in life come in doing and not in dodging duty; in meeting and solving problems
    in facing facts, in being a dependable person. - Richard L. Evans",
    "There is little difference in people, but that little difference makes a big difference. The little
    difference is attitude. The big difference is whether it is positive or negative. - W . Clement Stone",
    "Nothing can stop the man with the right mental attitude from achieving his goal.Nothing can help
    the man with the wrong attitude. - Thomas Jefferson",
    "Every great and commanding moment in the annals of the world is the triumph of somebody’s enthusiasm.
    - Ralph Waldo Emerson",
    var array_length = r_text.length - 1;
    var random_index = Math.round ( array_length * Math.random ( ) );

    return ( r_text [ random_index ] );
    }

    <script language="JavaScript1.2" src="images/mm_menu.js"></script>
    </head>


    All of that is in the head beacuse of a js menu I have on the top part of the page.

    in the body what I have is :

    <body>
    <strong><em>&quot;TO GET YOU WHAT YOU WANT <br>
    IN THE TIME THAT YOU WANT IT.</em></strong></font><em><strong>&quot;</strong></em></p>
    <p align="center">
    <script language="JavaScript">
    document.write ( quotes ());
    </script>
    </body>

    any help on this would be great.
    thanks
    ********
    Regards,

    P

  4. #4
    SitePoint Evangelist Mr. Brownstone's Avatar
    Join Date
    May 2002
    Location
    Relative
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this (save it as index2.html then open it in your browser):
    Code:
    <html>
    
    <head>
    
    <title>Welcome to Exit Realty RSVP!</title>
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
    <script language="JavaScript1.2" src="images/mm_menu.js"></script>
    
    <script language="JavaScript">
    <!--
    
    	function mmLoadMenus() {
    	  if (window.mm_menu_0123223141_0) return;
    	  window.mm_menu_0123223141_0 = new Menu("root",110,20,"Arial, Helvetica, sans-serif",16,"#000000","#ffffff","#cccccc","#000084","center","middle",2,0,1000,-5,7,true,true,true,0,true,true);
    	  mm_menu_0123223141_0.addMenuItem("Our&nbsp;Agents","location='http://www.exitrealtyrsvp.com/age.htm'");
    	  mm_menu_0123223141_0.addMenuItem("Our&nbsp;Staff","location='http://www.exitrealtyrsvp.com/staff.htm'");
    	  mm_menu_0123223141_0.addMenuItem("Join&nbsp;Our&nbsp;Team","location='http://www.exitrealtyrsvp.com/join.htm'");
    	   mm_menu_0123223141_0.hideOnMouseOut=true;
    	   mm_menu_0123223141_0.menuBorder=1;
    	   mm_menu_0123223141_0.menuLiteBgColor='#ffffff';
    	   mm_menu_0123223141_0.menuBorderBgColor='#555555';
    	   mm_menu_0123223141_0.bgColor='#555555';
    	  window.mm_menu_0118153407_0 = new Menu("root",61,20,"Arial, Helvetica, sans-serif",16,"#000000","#ffffff","#cccccc","#000084","center","middle",2,0,1000,-5,7,true,true,true,0,true,true);
    	  mm_menu_0118153407_0.addMenuItem("Nassau","location='http://www.exitrealtyrsvp.com/nass.htm'");
    	  mm_menu_0118153407_0.addMenuItem("Suffolk","location='http://www.exitrealtyrsvp.com/suff.htm'");
    	   mm_menu_0118153407_0.hideOnMouseOut=true;
    	   mm_menu_0118153407_0.menuBorder=1;
    	   mm_menu_0118153407_0.menuLiteBgColor='#ffffff';
    	   mm_menu_0118153407_0.menuBorderBgColor='#555555';
    	   mm_menu_0118153407_0.bgColor='#555555';
    	  window.mm_menu_0118153407_1 = new Menu("root",140,18,"Arial, Helvetica, sans-serif",14,"#000000","#ffffff","#cccccc","#000084","left","middle",2,0,1000,-5,7,true,true,true,0,true,true);
    	  mm_menu_0118153407_1.addMenuItem("Mission&nbsp;Statement","location='http://www.exitrealtyrsvp.com/miss.htm'");
    	  mm_menu_0118153407_1.addMenuItem("How&nbsp;we&nbsp;can&nbsp;help&nbsp;you","location='http://www.exitrealtyrsvp.com/form.html'");
    	  mm_menu_0118153407_1.addMenuItem("Location","location='http://www.exitrealtyrsvp.com/loc.htm'");
    	  mm_menu_0118153407_1.addMenuItem("Contact&nbsp;Us","location='http://www.exitrealtyrsvp.com/contc.htm'");
    	   mm_menu_0118153407_1.hideOnMouseOut=true;
    	   mm_menu_0118153407_1.menuBorder=1;
    	   mm_menu_0118153407_1.menuLiteBgColor='#ffffff';
    	   mm_menu_0118153407_1.menuBorderBgColor='#555555';
    	   mm_menu_0118153407_1.bgColor='#000000';
    
    	  mm_menu_0118153407_1.writeMenus();
    	} 
    
    	mmLoadMenus()
    
    // -->
    </script>
    
    <script language="JavaScript">
    <!--
    
    	function quotes( ) {
    		var r_text = new Array (
    			"“Happy is the man who has broken the chains which hurt the mind, and has given up worrying once and for all.” - <i>Ovid</i>",
    			"“Keep away from people who try to belittle your ambitions. Small people always do that but the really great make you feel that you too can become great!” - <i>Mark Twain</i>",
    			"“Become a possibilitarian. No matter how dark things seem to be or actually are raise your sights and see the possibilities—always see them, for they’re always there.” - <i>Norman Vincent Peale</i>",
    			"“The sincerest satisfactions in life come in doing and not in dodging duty; in meeting and solving problems in facing facts, in being a dependable person.” - <i>Richard L. Evans</i>",
    			"“There is little difference in people, but that little difference makes a big difference. The little difference is attitude. The big difference is whether it is positive or negative.” - <i>W . Clement Stone</i>",
    			"“Nothing can stop the man with the right mental attitude from achieving his goal. Nothing can help the man with the wrong attitude.” - <i>Thomas Jefferson</i>",
    			"“Every great and commanding moment in the annals of the world is the triumph of somebody’s enthusiasm.” - <i>Ralph Waldo Emerson</i>"
    		);
    
    		var array_length = r_text.length - 1;
    		var random_index = Math.round ( array_length * Math.random ( ) );
    
    		return ( r_text [ random_index ] + '' );
    	}
    
    // -->
    </script>
    
    </head>
    
    <body topmargin="5" leftmargin="0" rightmargin="0">
    <div align="center"> 
      <table width="650" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td height="151" align="center" valign="top" bgcolor="#CCCCCC"> <img name="headermain" src="images/headermain.jpg" width="650" height="125" border="0" usemap="#m_headermain" alt=""><font size="5" face="Times New Roman, Times, serif"><br>
            <script language="JavaScript1.2">mmLoadMenus();</script>
    
            <img name="menu" src="images/menu.jpg" width="600" height="26" border="0" usemap="#m_menu" alt="">
            <map name="m_menu">
              <area shape="rect" coords="476,6,588,23" href="http://www.exitrealtyrsvp.com/age.htm" alt="" onMouseOut="MM_startTimeout();"  onMouseOver="MM_showMenu(window.mm_menu_0123223141_0,476,28,null,'menu');"  >
              <area shape="rect" coords="346,6,426,23" href="http://www.exitrealtyrsvp.com/ref.htm" alt="" >
              <area shape="rect" coords="227,6,301,22" href="#" alt="" onMouseOut="MM_startTimeout();"  onMouseOver="MM_showMenu(window.mm_menu_0118153407_0,234,24,null,'menu');"  >
              <area shape="rect" coords="105,8,176,23" href="#" alt="" onMouseOut="MM_startTimeout();"  onMouseOver="MM_showMenu(window.mm_menu_0118153407_1,106,27,null,'menu');"  >
              <area shape="rect" coords="8,8,58,22" href="http://www.exitrealtyrsvp.com" alt="" >
            </map>
            <br>
    
            </font> 
            <hr align="center" size="1"> </td>
        </tr>
        <tr> 
          <td height="299" align="center" valign="top" bgcolor="#CCCCCC"><p><font size="5" face="Times New Roman, Times, serif">Welcome 
              to Exit Realty, RSVP!<br>
              </font><font color="#006699" size="3" face="Times New Roman, Times, serif"><em>59 
              Surry Circle Shirley, New York 11967 <strong>(631)-395-6640</strong></em></font></p>
            <p align="left"><font size="3" face="Arial, Helvetica, sans-serif"><img src="images/index.jpg" width="325" height="205" align="left"><strong>LOOKING 
              FOR A NEW HOME??<br>
    
              Buying? Selling, or Renting?<br>
              TELL US YOUR NEEDS?? </strong><br>
              <br>
              The <strong>EXIT</strong> Team is here for you<br>
              ready to provide you with:<br>
    
              <br>
              Five times the service!<br>
              Five times the speed!<br>
              Five times the focus!<br>
              <strong><em>&quot;TO GET YOU WHAT YOU WANT <br>
              IN THE TIME THAT YOU WANT IT.</em></strong></font><em><strong>&quot;</strong></em></p>
    
    		<p align="center">
    
    			<script language="JavaScript">
    				document.write ( quotes ( ) );
    			</script>
    
    		</p>
    
            <p align="left"><font size="2" face="Arial, Helvetica, sans-serif"><em><a href="http://www.gzws.com"><br>
              This site was created by: Gloryzone Websolutions</a>&copy;</em></font></p>
            </td>
        </tr>
    
      </table>
    </div>
    
    </body>
    
    </html>
    Specifically, note the different <script> tags and their position within the <head> tag, and the single <script> tag within the main <body>. It seems to work alright for me.
    Of course, that's just my opinion. I could be wrong.

  5. #5
    SitePoint Guru tombempty's Avatar
    Join Date
    Oct 2001
    Location
    New York
    Posts
    688
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    yes butttttt

    I know that works and I thank you for that but this is the original problem I was running into. When I add this random script it seems to diable my drop down menu also in js.

    any thoughts on that?
    ********
    Regards,

    P

  6. #6
    SitePoint Guru tombempty's Avatar
    Join Date
    Oct 2001
    Location
    New York
    Posts
    688
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking ok forget it....

    I found what was causing the menu not to work.....

    thanks brown

    thanks a lot.

    PM
    ********
    Regards,

    P

  7. #7
    SitePoint Evangelist Mr. Brownstone's Avatar
    Join Date
    May 2002
    Location
    Relative
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It was that naughty “//” comment, eh?

    No problem.
    Of course, that's just my opinion. I could be wrong.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •