Results 1 to 4 of 4

Thread: Pausing up-down Scroller: want to display mucho HTML but not in <head> becos of SEO

  1. #1
    Join Date
    Feb 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Pausing up-down Scroller: want to display mucho HTML but not in <head> becos of SEO

    1) Script Title:

    Pausing up-down Scroller

    2) Script URL (on DD):

    http://www.dynamicdrive.com/dynamicindex2/crosstick.htm

    3) Describe problem:

    Before I begin, I'm a beginner at JavaScript but know a little PHP.

    Our current site www.altmore.co.uk uses "Cross Browser marquee II" but because of performance issues on FF (see bug report at
    Code:
    http://www.dynamicdrive.com/forums/showthread.php?t=41987
    ) I want to move to the Pausing up-down scroller, which only causes CPU usage to go to ~10-20%.

    I read with interest a related though different problem in
    Code:
    http://www.dynamicdrive.com/forums/showthread.php?t=33460&highlight=Pausing+up-down+Scroller.
    However, as you can see from www.altmore.co.uk and view page source the generated HTML we want to put into the scroller is massive (1000 lines ?) so I don't want to put that into the <head> as it will kill our site for SEO, as the text we want the SE's to find is near the top of <body>, and search engines won't bother reading down that far, if they have tons of HTML in <head>.

    Interesting! I've just read
    Code:
    http://www.dynamicdrive.com/forums/showthread.php?t=14259&highlight=Pausing+up-down+Scroller
    "Everything between <script type="text/javascript"> and </script> that is in Step 1 on the demo page may be placed in an external file."

    Now I'm already familiar with external .js files as you can see from our site, but now I'm thinking about running PHP from within the EXTERNAL javascript to generate the content as per the FIRST post above !! (I've never tried running PHP from javascript before and didn't know one could do it... till now)

    Or, is it too late to run PHP from within the external javascript because the external javascript won't be executed until it gets loaded into the client ?
    I suspect yes.....
    :-(

    But now I'm at the bottom of this last post and John says:

    "Notes: The pausecontent array can be defined in the second block on the page (before the new pausescroller() call) instead of in the external script,"

    ..so if we do our PHP in here, we should be able to generate the 1000+ lines of HTML down the page and after the content we want the SE's to index ?

    ...or maybe there's an easier way to do this that my untutored eye is missing (in which case pls enlighten)

  2. #2
    Join Date
    Feb 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It appears that the scroller won't work if I try and put multiline strings into the array like this:
    Code:
    pausecontent[3]='<a href="http://www.altmore.co.uk/.test/view.php?job_id=515&auth_sess=85ce247bfde5eb95ea6cf0b53c11da2e&ref=0f4b52cb0ae215a42169af4b6" class="nav">DB2 
                        Support Analysts</a><br /> <font color="#000000" style="font-size: 9px; font-face: verdana;"> 
                        DB2 Support Analysts Salary £Excellent + Package I am leading 
                        several senior mainframe technology searches for experienced 
                        DB2 professionals. In this dynamic role you willl be responsible 
                        for the day-to-day support of DB2 Subsystems in a datasharing 
                        and non datasharing environment. Our client i ......</font> 
                        [<a href="http://www.altmore.co.uk/.test/view.php?job_id=515&auth_sess=85ce247bfde5eb95ea6cf0b53c11da2e&ref=0f4b52cb0ae215a42169af4b6" class="navi">read 
                        more</a>] <br /> <br /> <br />'
    Instead I have to stretch the content out on one long line ?

    Or is there a way to break this string up in javascript (pardon my ignorance) so it can still be seen as one entity, but be typed over multi-lines for convenience / sanity ?

  3. #3
    Join Date
    Feb 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok, a quick visit to w3schools.com has taught me about using \ at the end of lines to break up a string, hence:
    Code:
    pausecontent[3]='<a href="http://www.altmore.co.uk/.test/view.php?job_id=515&auth_sess=85ce247bfde5eb95ea6cf0b53c11da2e&ref=0f4b52cb0ae215a42169af4b6" class="nav">DB2 \
                        Support Analysts</a><br /> <font color="#000000" style="font-size: 9px; font-face: verdana;"> \
                        DB2 Support Analysts Salary £Excellent + Package I am leading \
                        several senior mainframe technology searches for experienced \
                        DB2 professionals. In this dynamic role you willl be responsible \
                        for the day-to-day support of DB2 Subsystems in a datasharing \
                        and non datasharing environment. Our client i ......</font> \
                        [<a href="http://www.altmore.co.uk/.test/view.php?job_id=515&auth_sess=85ce247bfde5eb95ea6cf0b53c11da2e&ref=0f4b52cb0ae215a42169af4b6" class="navi">read \
                        more</a>] <br /> <br /> <br />'
    works !

    Also, I'm guessing ' and " are interchangeable as string delimiters?

    And that use of ' here allows us to have " chars embedded in the string without causing any problems (and we could have vice versa, but not same-same) ?

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Yep on both counts. And you can always just backslash any quotations within your string, for example:

    Code:
    var phrase="My name is \"George\""
    DD Admin

Bookmarks

Posting Permissions

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