1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Preview text on front page.

Discussion in 'HTML & Website Design' started by northendtrooper, Dec 24, 2012.

  1. #1
    Merry Christmas everyone.

    On our site tenpercenttruth.com we are having lag issues because the amount of text. We are looking for a code that would have the user see only 150 characters on the frontpage but once they click on the text it would take them to a new page with the full text of 1500 characters. I'm having issues thinking of how we can do this so I greatly appreciate any help! Also I honestly can't think of any website that has this function.
    SEMrush
     
    northendtrooper, Dec 24, 2012 IP
    SEMrush
  2. hasanoben

    hasanoben Active Member

    Messages:
    128
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    90
    #2
    This may help you...
    Copy & paste this and you'll get the idea...
    Edit: I guess i get your question wrong.. I'll check it again.. Sorry about that..

    <html><head>
    <script type="text/javascript">
     function expand(elem) {
     elem.innerHTML = '-'
     document.getElementById('more').style.display = 'block'
    }
     </script>
    </head><body>
    <p>This is text.</p>
     <a href="#" onclick="expand(this)">+</a>
    <div id="more" style="display:none">This is more text</div>
    
    
    </body>
    </html>
    
    Code (markup):
     
    Last edited: Dec 24, 2012
    hasanoben, Dec 24, 2012 IP
  3. gigpayrr

    gigpayrr Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    try to use truncate functions
     
    gigpayrr, Dec 26, 2012 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,646
    Likes Received:
    1,976
    Best Answers:
    250
    Trophy Points:
    515
    #4
    You only have 6.7k of plaintext -- if that is causing 'lag issues' there is something horrifically WRONG with your server and/or hosting! You are blaming the wrong thing for your painfully long pageloads.

    The problem is you're wasting 50k of HTML, 1.3 MEGABYTES of Javascript (that's loading another 348k of 'documents'), 559k of images and a whopping 110k of CSS -- totalling an ungodly 77 separate files to deliver it!!! That's around 4 times as much HTML, and around four times as many files and twenty times the upper limit I'd allow for a total site size. You're wasting 2.3 MEGABYTES on delivering less than 7k of simple (poorly formatted) plaintext!!!

    ... and you're blaming the amount of content on the page?

    Get rid of ALL the "sharethis" crap (since it's doubling the page size), find some leaner social networking scripts (or manually link), use semantic markup, separation of presentation from content, etc, etc... and get rid of ANY of the scripting you don't actually need for the site to function. Learn about semantic markup, separation of presentation from content, condensing CSS properties, learn to leverage inheritance, STOP redeclaring the same thing over and over again for no reason in the CSS...

    There is NO legitimate reason for a page that simple to be totaling more than 20k of HTML, 24k of CSS, 24k of 'theme' images (not counting content images), and I'd never allow more than 64k of scripting on a site... in around 16 files... I would probably bring it in far, FAR under that... though I would be swinging an axe at a LOT of the 'gee ain't it neat' garbage and the social networking nobody uses to focus on the ones people do use. (FB, Twitter, G+).

    Bottom line, the problem with your site, and any 'lag' issues have NOTHING to do with your content, and everything to do with how the site is built. You are blaming 0.28% of the site, ignoring the 99.72% that's the actual problem.
     
    Last edited: Dec 26, 2012
    deathshadow, Dec 26, 2012 IP
  5. Hefaistos

    Hefaistos Active Member

    Messages:
    194
    Likes Received:
    14
    Best Answers:
    9
    Trophy Points:
    63
    Digital Goods:
    1
    #5
    That amount of text itself should not cause any lag issues, so the problems are more likely described by deathshadow in the reply above.
     
    Hefaistos, Dec 28, 2012 IP
  6. northendtrooper

    northendtrooper Member

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #6
    I will be honest. We are not the greatest at web scripting and is slowly learning. We purchased the rights from Fmyscript (which I'll never do again) and trying to enhance the site to our needs. If you can somehow tweek our site to be that much faster with additions then PM me and I would love to talk to you.
     
    northendtrooper, Dec 28, 2012 IP