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 2 of 2

Thread: asc2i

  1. #1
    New to the CF scene
    Join Date
    Jun 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    asc2i

    Hi,
    First, my code works good enough for me in InternetExplorer. Firefox handles the span break differently. This is only notes, not intended to be published. So, please help for now with IE.
    My code is getting hung up on the button that includes "10k", it does not write anything!?
    I am only trying to see what all the characters are available to me.
    (uploading .txt if this does not paste well for you)

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD><TITLE>asci2</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=windows-1252">
    <STYLE type=text/CSS>BODY {
    MARGIN: 2px
    }
    #chars {
    BORDER-RIGHT: green 1px solid; BORDER-TOP: green 1px solid; FONT-SIZE: 10px; BORDER-LEFT: green 1px solid; BORDER-BOTTOM: green 1px solid; FONT-FAMILY: times new roman
    }
    .bord {
    PADDING-RIGHT: 1px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 1px; PADDING-BOTTOM: 1px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 10px; COLOR: #999999; PADDING-TOP: 1px
    }
    .cha {
    FONT-SIZE: 16px; COLOR: #300030
    }
    .buts {
    FONT-SIZE: 10px; FONT-FAMILY: comic sans ms
    }
    </STYLE>

    <SCRIPT language=JavaScript>
    function getChars(L,H){
    k='';
    for(i=L;i<H;i++){
    k+='<span class="bord"><span class="cha">&#'+i+';</span><br> &#38#'+i+';</span>'}
    document.getElementById('chars').innerHTML=k;
    }
    function abc(){
    var step=1500;var z='';
    for(i=1,k=step;i<30000;i+=step,k+=step){
    z+='<button class="buts" onclick="getChars(\''+i+'\',\''+k+'\')">'+((k-step)/1000)+'-'+(k/1000)+'K</button>';}
    document.getElementById('buttons').innerHTML=z;
    }
    </SCRIPT>

    <META content="MSHTML 6.00.2900.2912" name=GENERATOR></HEAD>
    <BODY onload=abc()>
    <DIV id=buttons>&nbsp;</DIV>
    <DIV id=chars>&nbsp;</DIV></BODY></HTML>
    Attached Files Attached Files

  • #2
    Regular Coder
    Join Date
    Jul 2005
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is there a reason you're converting the numeric values into strings before passing them into getChars? That's what is causing the problem.

    This fixes it:
    Code:
    z+='<button class="buts" onclick="getChars('+i+','+k+')">'+((k-step)/1000)+'-'+(k/1000)+'K</button>';}


  •  

    Posting Permissions

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