+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 19
Like Tree5Likes

Thread: Java Scripts

  1. #1
    dumidu1424 is offline x10Hosting Member dumidu1424 is an unknown quantity at this point
    Join Date
    Jan 2011
    Posts
    15

    Thumbs up Java Scripts

    Post java scripts here...

    ---------- Post added at 04:52 PM ---------- Previous post was at 04:45 PM ----------

    Div style for title..

    <div style="border:2px solid#001000"><div style="border:2px solid#002000"><div style="border:2px solid#003000"><div style="border:2px solid#004000"><div style="border:2px solid#005000"><div style="border:2px solid#006000"><div style="border:2px solid#007000"><div style="border:2px solid#008000"><div style="border:2px solid#009000"><center>Your text</center></div></div></div></div></div></div></div></div></div>

    ---------- Post added at 04:55 PM ---------- Previous post was at 04:52 PM ----------

    Div style for title..

    <div style="border:2px solid#002200"><div style="border:2px solid#003300"><div style="border:2px solid#004400"><div style="border:2px solid#005500"><div style="border:2px solid#002200"><div style="border:2px solid#003300"><div style="border:2px solid#004400"><div style="border:2px solid#005500"><center>Your text</center></div></div></div></div></div></div></div></div>

    ---------- Post added at 04:58 PM ---------- Previous post was at 04:55 PM ----------

    Div style for title..

    <div style="border:1px solid#ffffff;solid;margin=1px;padding:1px"><div style="border:1px solid#ffffff;solid;margin=1px;padding:1px"><div style="background-color:black;border-style:ridge;border-width:2px;border-color:red;margin:2px"><div style='background-color:black;border-style:ridge;border-width:2px;border-color:silver;margin:2px;padding:2px'><table align='center' width='100%' border='2px'><tr><td align='center' bgcolor='black' background="http://URL GAMBAR">Your text here</td></tr></table></div></div></div></div></div></div>

    ---------- Post added at 05:10 PM ---------- Previous post was at 04:58 PM ----------

    Text input code

    <input type="text" name="text1" size="25" maxlength="30" value="YourText">
    Last edited by dumidu1424; 06-01-2011 at 05:11 AM.

  2. #2
    vv.bbcc19's Avatar
    vv.bbcc19 is offline Community Advocate vv.bbcc19 is just really nice
    Join Date
    Jun 2010
    Location
    India
    Posts
    1,505

    Re: Java Scripts

    Kindly put a description of what the code does too..this will help people comprehend the script easily.
    Nice thread with a good start.
    BCV | Community Support Representative
    █ x10Hosting - Giving Away Hosting Since 2004
    Premium Hosting | VPS Services

  3. #3
    dumidu1424 is offline x10Hosting Member dumidu1424 is an unknown quantity at this point
    Join Date
    Jan 2011
    Posts
    15

    Re: Java Scripts

    Date And Time

    <font color="blue"><b><small><script>document.write (Date()+ ".")</script></b></small></font></br>

    ---------- Post added at 10:28 AM ---------- Previous post was at 10:24 AM ----------

    Goole Serch

    <b><i><font color="blue">G</font><font color="red">o</font><font color="yellow">o</font><font color="blue">g</font><font color="green">l</font><font color="red">e</font></i></b></br><form method"get" action="http://www.google.co.id/xhtml"> <p> <input type="text" name="q" maxlength="2048" size="15" value=""/><input type="hidden" name="hl" value="id"/><input type="hidden" name="Ir" value="http://www.google.co.id/xhtml"/><input type="hidden" name="ie" value="Iso-8859-1"/><br/> <input type="submit" name="Submit" value="Search"/><br/> <input type="radio" name="site" value="search" checked="checked"/>Web<br/> <input type="radio" name="site" value="images"/>Image<br/> <input type="radio" name="site" value="mobile"/>Mobile<br/>

    ---------- Post added at 10:37 AM ---------- Previous post was at 10:28 AM ----------

    Online Calculator

    <form name="Calc">
    <input type="hidden" name="PHPSESSID" value="50806ec01522c5e900c9cf932340f1cc" />
    <center>
    <input disabled="disabled" type="text" style="font-weight: bolder; font-size: large;" name="Input"/>
    <input type="hidden" name="PHPSESSID" value="6be315796135a9d9627813b4af5fb2ad" />
    </center>
    <table>
    <tr>
    <th>
    <input type="button" name="one" value=" 1 " OnClick="Calc.Input.value += '1'"/>
    </th>
    <th>
    <input type="button" name="two" value=" 2 " OnCLick="Calc.Input.value += '2'"/>
    </th>
    <th>
    <input type="button" name="three" value=" 3 " OnClick="Calc.Input.value += '3'"/>
    </th>
    <th>
    <input type="button" name="plus" value=" + " OnClick="Calc.Input.value += ' + '"/>
    </th>
    </tr>
    <tr>
    <th>
    <input type="button" name="four" value=" 4 " OnClick="Calc.Input.value += '4'"/>
    </th>
    <th>
    <input type="button" name="five" value=" 5 " OnCLick="Calc.Input.value += '5'"/>
    </th>
    <th>
    <input type="button" name="six" value=" 6 " OnClick="Calc.Input.value += '6'"/>
    </th>
    <th>
    <input type="button" name="minus" value=" - " OnClick="Calc.Input.value += ' - '"/>
    </th>
    </tr>
    <tr>
    <th>
    <input type="button" name="seven" value=" 7 " OnClick="Calc.Input.value += '7'"/>
    </th>
    <th>
    <input type="button" name="eight" value=" 8 " OnCLick="Calc.Input.value += '8'"/>
    </th>
    <th>
    <input type="button" name="nine" value=" 9 " OnClick="Calc.Input.value += '9'"/>
    </th>
    <th>
    <input type="button" name="times" value=" * " OnClick="Calc.Input.value += ' * '"/>
    </th>
    </tr>
    <tr>
    <th>
    <input type="button" name="zerozero" value="00" OnClick="Calc.Input.value += '00'"/>
    </th>
    <th>
    <input type="button" name="zero" value=" 0 " OnClick="Calc.Input.value += '0'"/>
    </th>
    <th>
    <input type="button" name="point" value=" . " OnClick="Calc.Input.value += '.'"/>
    </th>
    <th>
    <input type="button" name="div" value=" / " OnClick="Calc.Input.value += ' / '"/>
    </th>
    </tr>
    </table>
    <table>
    <tr>
    <th>
    <input type="button" name="clear" value=" Clear " OnClick="Calc.Input.value = ''"/>
    </th>
    <th>
    <input type="button" name="DoIt" value=" Total " OnClick="Calc.Input.value = eval(Calc.Input.value)"/>
    </th>
    </tr>
    <tr>
    </tr>
    </table>
    </form>


    ---------- Post added at 10:42 AM ---------- Previous post was at 10:37 AM ----------

    Color background table

    <table width="100%" border="3">
    <tr>
    <td>MENU 1</td>
    <td>MENU 2</td>
    <td>MENU 3</td>
    <br />
    <tr>
    <td>MENU 4</td>
    <td>MENU 5</td>
    <td>MENU 6</td>
    </tr>
    <tr>
    <td>MENU 7</td>
    <td>MENU 8</td>
    <td>MENU 9</td>
    </tr>
    </table>


    ---------- Post added at 10:46 AM ---------- Previous post was at 10:42 AM ----------

    Rainbow Div

    <div align="center"><div style="border:1px solid #002222"><div style="border:1px solid #003333"><div style="border:1px solid #004444"><div style="border:1px solid #005555"><div style="border:1px solid #006666"><div style="border:1px solid #007777"><div style="border:2px dotted lime"><div style="border:1px dotted lime"><div style="border:1px solid #007777"><div style="border:1px solid #006666"><div style="border:1px solid #005555"><div style="border:1px solid #004444"><div style="border:1px solid #003333"><div style="border:1px solid #002222"><div style="border:1px solid #001111"><div style="border:1px solid #004444"><div style="border:1px solid #003333"><div style="border:1px solid #002222"><div style="border:1px solid #001111"><div style="background-image:url(http://clickmaster.xtgem.com/Background/1.gif)"><font color="lime"><b>SLCHAT.TK™</b></font></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
    vv.bbcc19 likes this.

  4. #4
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Java Scripts

    I see only one Javascript script, and no Java at all.

    Tables used for layout, presentational HTML, inline CSS, massive numbers of elements used non-structurally. No thanks.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  5. #5
    dumidu1424 is offline x10Hosting Member dumidu1424 is an unknown quantity at this point
    Join Date
    Jan 2011
    Posts
    15

    Re: Java Scripts

    Which java scripts you want?

  6. #6
    dumidu1424 is offline x10Hosting Member dumidu1424 is an unknown quantity at this point
    Join Date
    Jan 2011
    Posts
    15

    Re: Java Scripts

    disco color change background

    <body onload="disco()"><script language="JavaScript">
    <!--
    //slchat
    r=255;
    g=255;
    b=255;
    flag=0;
    t=new Array;
    o=new Array;
    d=new Array;

    function hex(a,c)
    {
    t[a]=Math.floor(c/16)
    o[a]=c%16
    switch (t[a])
    {
    case 10:
    t[a]='A';
    break;
    case 11:
    t[a]='B';
    break;
    case 12:
    t[a]='C';
    break;
    case 13:
    t[a]='D';
    break;
    case 14:
    t[a]='E';
    break;
    case 15:
    t[a]='F';
    break;
    default:
    break;
    }
    switch (o[a])
    {
    case 10:
    o[a]='A';
    break;
    case 11:
    o[a]='B';
    break;
    case 12:
    o[a]='C';
    break;
    case 13:
    o[a]='D';
    break;
    case 14:
    o[a]='E';
    break;
    case 15:
    o[a]='F';
    break;
    default:
    break;
    }
    }

    function ran(a,c)
    {
    if ((Math.random()>2/3||c==0)&&c<255)
    {
    c++
    d[a]=2;
    }
    else
    {
    if ((Math.random()<=1/2||c==255)&&c>0)
    {
    c--
    d[a]=1;
    }
    else d[a]=0;
    }
    return c
    }
    function do_it(a,c)
    {
    if ((d[a]==2&&c<255)||c==0)
    {
    c++
    d[a]=2
    }
    else
    if ((d[a]==1&&c>0)||c==255)
    {
    c--;
    d[a]=1;
    }
    if (a==3)
    {
    if (d[1]==0&&d[2]==0&&d[3]==0)
    flag=1
    }
    return c
    }
    function disco()
    {
    if (flag==0)
    {
    r=ran(1, r);
    g=ran(2, g);
    b=ran(3, b);
    hex(1,r)
    hex(2,g)
    hex(3,b)
    document.body.style.background="#"+t[1]+o[1]+t[2]+o[2]+t[3]+o[3]
    flag=50
    }
    else
    {
    r=do_it(1, r)
    g=do_it(2,g)
    b=do_it(3,b)
    hex(1,r)
    hex(2,g)
    hex(3,b)
    document.body.style.background="#"+t[1]+o[1]+t[2]+o[2]+t[3]+o[3]
    flag--
    }

    setTimeout('disco()',50)
    }
    //-->
    </script>
    ksze.sz.ifi69 likes this.

  7. #7
    dumidu1424 is offline x10Hosting Member dumidu1424 is an unknown quantity at this point
    Join Date
    Jan 2011
    Posts
    15

    Re: Java Scripts

    did you test this script

    ---------- Post added at 02:21 AM ---------- Previous post was at 02:10 AM ----------

    Forward Button

    <a href="javascript:history.forward(1)">FORWARD</a>

    ---------- Post added at 02:22 AM ---------- Previous post was at 02:21 AM ----------

    Refresh Button

    <form action="#"><div><input type="button" value="REFRESH" onClick="window.location.reload()"></input></div></form>

    ---------- Post added at 02:24 AM ---------- Previous post was at 02:22 AM ----------

    Page ending Lines

    <hrcolor="aqua"width="80%
    "size="2"><hr
    color="aqua"width="70%
    "size="2"><hr
    color="aqua"width="60%
    "size="2"><hr
    color="aqua"width="50%
    "size="2"><hr
    color="aqua"width="40%
    "size="2">

  8. #8
    maitreebhatt54 is offline x10Hosting Member maitreebhatt54 is an unknown quantity at this point
    Join Date
    May 2011
    Posts
    4

    Re: Java Scripts

    thanx..........
    dumidu1424 likes this.

  9. #9
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Java Scripts

    You don't really need to write a function to convert a number to hexadecimal. Number.toString will do that for you.

    The disco script should be placed within an anonymous function so the global namespace isn't polluted.

    Functions are first class data. Rather than having two branches in disco that are almost exactly the same, assign a function to a variable and use it outside the branches.

    Variable names should be descriptive. If you want a minified script, pass it through a minifier when publishing, but not before. The original source should be unminified so it can be read, updated & debugged.

    Arrays are indexed starting with 0, not 1 in JS. It's time to start counting like a programmer. Better still, use object properties.

    Magic numbers should be replaced with symbolic "constants" (JS doesn't have constants, so a variable will have to do).

    Code:
    (function () {
        var state_incr=2, state_decr=1, state_nochange=0;
        var r=255,g=255,b=255,
            counter=0,state={}, /* 'state' replaces 'd' */
            defaultPeriod=50, discoInterval;
    
        function first_step(name, value) {
            ...
        }
        function step(name,value) {
            if ((state[name]==state_incr && value<255) || value==0) {
                ++value;
                state[name]=state_incr;
            } else if ((state[name]==state_decr && value>0) || value==255) {
                --value;
                state[name]=state_decr;
            }
            return value;
        }
        function unstick() {
            if (state.r + state.g + state.b == state_nochange) {
                counter=0;
            }
        }
        function disco() {
            var delta, done, color;
            if (counter==0) {
                delta=first_step;
                done=function() {}
                counter=50;
            } else {
                delta=step;
                done=unstick;
                counter--;
            }
            r=delta('r', r);
            g=delta('g', g);
            b=delta('b', b);
            done();
            color = (r << 16 | g << 8 | b).toString(16);
            document.body.style.background="#"+color;
        }
        window.startDisco = function(period) {
            if (!period) {
                period = defaultPeriod;
            }
            if (! discoInterval) {
                discoInterval = setInterval(disco, period);
            }
        };
        window.stopDisco = function() {
            clearInterval(discoInterval);
            discoInterval=0;
        }
        
        startDisco();
    })();
    Of coures, the best improvement is simply to discard the whole script. From a graphic design perspective, it's a terrible idea.

    Note [code] tags make code more readable. For PHP and HTML, there's [php] and [html] tags, respectively.
    Last edited by misson; 06-26-2011 at 07:33 AM.
    vekou and essellar like this.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  10. #10
    vol7ron's Avatar
    vol7ron is offline x10 Lieutenant vol7ron is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    DC
    Posts
    434

    Re: Java Scripts

    @mission: I don't think that works
    If you find my post useful please add to my reputation by clicking the +Rep button
    You may also use the Donate link to donate credits - this is appreciated too Thanks to those whom have donated so far!


+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Java Scripts
    By medina in forum Tutoriales
    Replies: 8
    Last Post: 11-25-2009, 02:50 PM
  2. Replies: 0
    Last Post: 08-19-2008, 07:56 AM
  3. Replies: 6
    Last Post: 08-12-2007, 11:19 AM
  4. Java?
    By pensoftware in forum Free Hosting
    Replies: 2
    Last Post: 10-15-2005, 01:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers