Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with some JavaScript please

    Hi, new here & really not sure where to put this question. I got a copy & paste code from another site & I cannot get it to work for me. I want it to display alternating text daily. Can someone please tell me what I am doing wrong? I am sooo lost it's been awhile since I did any coding of any kind. lol



    <SCRIPT LANGUAGE="JavaScript">

    <!-- Begin
    var msg = new Array();
    Stamp = new Date();
    today = Stamp.getDate();
    msg[1] = "Tip 1 - For a dull punch, cut a piece of aluminum can out then punch through it several times";
    msg[2] = "Tip 2 - When using the heat embosser, place work on top of a good sized tile and you won't ended up with melted surface";
    msg[3] = "Tip 3 - Use a paper plate to catch your embossing powder, then squeeze it together and it will allow the powder to flow nicely back into the original container";
    msg[4] = "Tip 4 - Too lazy to clean make sponges after using so I just store each paint color in a small snack baggies and they stay soft until the next time they're needed! ";
    msg[5] = "Tip 5 - Use old magazines or phone books at my crafting table when I'm gluing or working on the edges of papers. The marker or glue can run off the paper I'm working on and not get my table all icky. Then when I'm done I just turn the page and start all over.";
    msg[6] = "Tip 6 - If you are using a sticker on a page or card along with pop dots to make it stand out, use baby powder on the part of the sticker that you don't want to stick to the page.";
    msg[7] = "Tip 7 - use an old bingo wand to pick up pins ";
    msg[8] = "Tip 8 - Acetone nail polish remover will revive an old marker pen when it gets dried up. Just dip the tip part in the acetone. Recap. Can use it again to write, draw, or color with in a couple hours.";
    msg[9] = "Tip 9 - MAKE YOUR OWN ADHESIVES ---Mix 3 pkgs. unflavored gelatin with 1 Tbsp. cold water and 3 Tbsp. boiling water. Stir until dissolved. Add 1/2 tsp. peppermint oil. Store it in a small covered tub. It will congeal so to use it, microwave for 10 seconds on high.";
    msg[10] = "Tip 10 - Print recipes on 4x6 photo paper -- no cutting necessary that way.";
    msg[11] = "Tip 11 - To keep up with all my pens I bought some small tins to keep my glaze, souffles and regular gel pens in. And I keep them upside down.";
    msg[12] = "Tip 12 - Spray punches with WD 40 and then cut out foil it keeps them sharp and moving you just have to make sure they are good and dry before you use them on your good paper";
    msg[13] = "Tip 13 - Save small lids to put glue on so you can dip the tip of a stylus or whatever when you need small "spots" of glue or they are good for holding tiny rhinestones/crystals if you will be using a bunch you can keep them contained instead of them getting all over from static electricity or whatever.";
    msg[14] = "Tip 14 - Tip for tea candles. After you burn it out and there is all the wax put it in the freezer when frozen it will pop out nice and clean. ";
    msg[15] = "Tip 15 - Stickles and color glitter glue on wax paper and parchment paper to make embellishments. Let dry over night and voila your own personal embelishments. You can even use scissors to trim them.";
    msg[16] = "Tip 16 - When you make something, sign it and date it if possible. Especially if you give it as a gift. ";
    msg[17] = "Tip 17 - If you spill beads, put a nylon over the vacuum hose and then suck them up. Make sure you don't turn off the vacuum until the hose is over a bowl.";
    msg[18] = "Tip 18 - Surgical clamps are great for holding things that need to dry.";
    msg[19] = "Tip 19 - Nail a yardstick on your workbench and you'll always have one handy..like the gals do in the fabric shops for measuring";
    msg[20] = "Tip 20 - Save the plastic baby wipe containers and put labels on them and you will soon have loads of organization in your craft room.";
    msg[21] = "Tip 21 - Use a lint roller to clean off your work area. It picks up everything! ";
    msg[22] = "Tip 22 - 'If you have something that is hot glued on..and you want to remove/reposition it, use an embossing gun and it will melt the hot glue
    msg[23] = "Tip 23 - 'Always store your ink pads upside down. That way, the ink will always be at the top.";
    msg[24] = "Tip 24 - Use aerosol hair spray to stiffen silk flowers. Use a blow dryer to dust them off";
    msg[25] = "Tip 25 - When you find a pattern or idea you like, print it off, put it in a page protector and then in a binder. Then you never have to go back and try and find what website you saw it on. I always copy and paste it into a word document, then I can add or delete what I want. I always put the website at the bottom too. ";
    msg[26] = "Tip 26 - Do not throw out old plastic table cloths or shower curtains. They are great to cover your table when spray painting stuff or for keeping your work area clean";
    msg[27] = "Tip 27 - Save old pop/bottle caps. They are great for putting small amounts of glue in. That way you do not have to keep stopping and squeezing the glue bottle. ";
    msg[28] = "Tip 28 - Go to Lowe's or any other store like that and get a large sheet of acrylic. Put that on your desk/workspace. It saves your workspace. I even pound my brads on it and it does nothing to it. ";
    msg[29] = "Tip 29 - Go to the hardware dept and get yourself a couple of them screw holders with the drawers. It is an excellent way or organizing brads, ribbon or anything small. You can see through them and see what you have in them";
    msg[30] = "Tip 30 - If your kids steal your scissors, put a combination lock around the finger holders. Only YOU can open it that way-works WONDERS!!!!";
    msg[31] = "Tip 31 - If you have ribbon specific scissors, tie a ribbon around one of the handles so you will never forget what it is for.";

    function writeTip() {
    document.write(msg[today]);
    }
    // End -->
    </script>

    <BODY>

    <b>Crafty Tip of the Day:</b>

    <script>
    writeTip();
    </script>

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    please WRAP your code.


    this works now
    Code:
    <script>
    var msg = new Array();
    Stamp = new Date();
    today = Stamp.getDate();
    msg[1] = "Tip 1 - For a dull punch, cut a piece of aluminum can out then punch through it several times";
    msg[2] = "Tip 2 - When using the heat embosser, place work on top of a good sized tile and you won't ended up with melted surface";
    msg[3] = "Tip 3 - Use a paper plate to catch your embossing powder, then squeeze it together and it will allow the powder to flow nicely back into the original container";
    msg[4] = "Tip 4 - Too lazy to clean make sponges after using so I just store each paint color in a small snack baggies and they stay soft until the next time they're needed! ";
    msg[5] = "Tip 5 - Use old magazines or phone books at my crafting table when I'm gluing or working on the edges of papers. The marker or glue can run off the paper I'm working on and not get my table all icky. Then when I'm done I just turn the page and start all over.";
    msg[6] = "Tip 6 - If you are using a sticker on a page or card along with pop dots to make it stand out, use baby powder on the part of the sticker that you don't want to stick to the page.";
    msg[7] = "Tip 7 - use an old bingo wand to pick up pins ";
    msg[8] = "Tip 8 - Acetone nail polish remover will revive an old marker pen when it gets dried up. Just dip the tip part in the acetone. Recap. Can use it again to write, draw, or color with in a couple hours.";
    msg[9] = "Tip 9 - MAKE YOUR OWN ADHESIVES ---Mix 3 pkgs. unflavored gelatin with 1 Tbsp. cold water and 3 Tbsp. boiling water. Stir until dissolved. Add 1/2 tsp. peppermint oil. Store it in a small covered tub. It will congeal so to use it, microwave for 10 seconds on high.";
    msg[10] = "Tip 10 - Print recipes on 4x6 photo paper -- no cutting necessary that way.";
    msg[11] = "Tip 11 - To keep up with all my pens I bought some small tins to keep my glaze, souffles and regular gel pens in. And I keep them upside down.";
    msg[12] = "Tip 12 - Spray punches with WD 40 and then cut out foil it keeps them sharp and moving you just have to make sure they are good and dry before you use them on your good paper";
    msg[13] = "Tip 13 - Save small lids to put glue on so you can dip the tip of a stylus or whatever when you need small \"spots\" of glue or they are good for holding tiny rhinestones/crystals if you will be using a bunch you can keep them contained instead of them getting all over from static electricity or whatever.";
    msg[14] = "Tip 14 - Tip for tea candles. After you burn it out and there is all the wax put it in the freezer when frozen it will pop out nice and clean. ";
    msg[15] = "Tip 15 - Stickles and color glitter glue on wax paper and parchment paper to make embellishments. Let dry over night and voila your own personal embelishments. You can even use scissors to trim them.";
    msg[16] = "Tip 16 - When you make something, sign it and date it if possible. Especially if you give it as a gift. ";
    msg[17] = "Tip 17 - If you spill beads, put a nylon over the vacuum hose and then suck them up. Make sure you don't turn off the vacuum until the hose is over a bowl.";
    msg[18] = "Tip 18 - Surgical clamps are great for holding things that need to dry.";
    msg[19] = "Tip 19 - Nail a yardstick on your workbench and you'll always have one handy..like the gals do in the fabric shops for measuring";
    msg[20] = "Tip 20 - Save the plastic baby wipe containers and put labels on them and you will soon have loads of organization in your craft room.";
    msg[21] = "Tip 21 - Use a lint roller to clean off your work area. It picks up everything! ";
    msg[22] = "Tip 22 - If you have something that is hot glued on..and you want to remove/reposition it, use an embossing gun and it will melt the hot glue ";
    msg[23] = "Tip 23 - Always store your ink pads upside down. That way, the ink will always be at the top.";
    msg[24] = "Tip 24 - Use aerosol hair spray to stiffen silk flowers. Use a blow dryer to dust them off";
    msg[25] = "Tip 25 - When you find a pattern or idea you like, print it off, put it in a page protector and then in a binder. Then you never have to go back and try and find what website you saw it on. I always copy and paste it into a word document, then I can add or delete what I want. I always put the website at the bottom too. ";
    msg[26] = "Tip 26 - Do not throw out old plastic table cloths or shower curtains. They are great to cover your table when spray painting stuff or for keeping your work area clean";
    msg[27] = "Tip 27 - Save old pop/bottle caps. They are great for putting small amounts of glue in. That way you do not have to keep stopping and squeezing the glue bottle. ";
    msg[28] = "Tip 28 - Go to Lowe's or any other store like that and get a large sheet of acrylic. Put that on your desk/workspace. It saves your workspace. I even pound my brads on it and it does nothing to it. ";
    msg[29] = "Tip 29 - Go to the hardware dept and get yourself a couple of them screw holders with the drawers. It is an excellent way or organizing brads, ribbon or anything small. You can see through them and see what you have in them";
    msg[30] = "Tip 30 - If your kids steal your scissors, put a combination lock around the finger holders. Only YOU can open it that way-works WONDERS!!!!";
    msg[31] = "Tip 31 - If you have ribbon specific scissors, tie a ribbon around one of the handles so you will never forget what it is for.";
    
    function writeTip() { 
        document.write(msg[today]);
    }
    </script>
    <BODY>
    <b>Crafty Tip of the Day:</b>
    <script>writeTip();</script>

  • #3
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you sooo much. It was driving me nuts.



  •  

    Posting Permissions

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