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 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    How do you resize a element of javascript

    I have a <script></script> that I basically want to hide, so I want to resize it to 1px by 1px. I have tried putting it inside <div></div> and <span></span> tags but that didn't work. I am new to this forum and I thought if anyone could help, it would be someone from here.

    Any help would be greatly appreciated. Thanks in advance

  • #2
    met
    met is offline
    Regular Coder
    Join Date
    Oct 2009
    Location
    United Kingdom
    Posts
    728
    Thanks
    4
    Thanked 119 Times in 119 Posts
    what?

    you can't "resize" javascript, it's a client side scripting language that does stuff. there's no visible output (unless the JS outputs something of course)

    if you want to hide the source, give up now, as it isn't possible.

  • #3
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    That makes sense, but the javascript does have an output. It puts a counter on my page that I would rather not have. Is there a way to resize the javascript's output, or at very least cover it up with an image or something?

    Again, thanks for the help.

  • #4
    met
    met is offline
    Regular Coder
    Join Date
    Oct 2009
    Location
    United Kingdom
    Posts
    728
    Thanks
    4
    Thanked 119 Times in 119 Posts
    perhaps post the javascript and any relevant code

  • #5
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Sure.

    <A href="http://www.alexa.com/siteinfo/www.askpersonalquestions.com"><SCRIPT type='text/javascript' language='JavaScript' src='http://xslt.alexa.com/site_stats/js/s/a?url=www.askpersonalquestions.com'></SCRIPT></A>

  • #6
    met
    met is offline
    Regular Coder
    Join Date
    Oct 2009
    Location
    United Kingdom
    Posts
    728
    Thanks
    4
    Thanked 119 Times in 119 Posts
    if you want to hide it, just remove it ? seems kind of redundant.

    anyway

    Code:
    <!DOCTYPE html>
    <head>
    <title>Untitled Document</title>
    <style type="text/css">
    /* will completely hide it..but anyone can still view it should they look at the source */
    #alexaStats { display:none; }
    </style>
    </head>
    
    <body>
    
    <div id="alexaStats">
    <A href="http://www.alexa.com/siteinfo/www.askpersonalquestions.com"><SCRIPT type='text/javascript' language='JavaScript' src='http://xslt.alexa.com/site_stats/js/s/a?url=www.askpersonalquestions.com'></SCRIPT></A> 
    </div> 
    
    </body>
    </html>
    the generated code has no IDs or Classes appended to it so it's just wrapped in a DIV and "hid" it.

  • Users who have thanked met for this post:

    Atari1596 (08-03-2010)

  • #7
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks, that worked perfectly. I really appreciate your help, met.


  •  

    Posting Permissions

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