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.
    northendtrooper, Dec 24, 2012 IP
  2. hasanoben

    hasanoben Active Member

    Likes Received:
    Best Answers:
    Trophy Points:
    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..

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

    gigpayrr Peon

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

    deathshadow Acclaimed Member

    Likes Received:
    Best Answers:
    Trophy Points:
    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

    Likes Received:
    Best Answers:
    Trophy Points:
    Digital Goods:
    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

    Likes Received:
    Best Answers:
    Trophy Points:
    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