PDA

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



zorba
02-19-2009, 10:56 PM
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


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


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


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)

zorba
02-19-2009, 11:25 PM
It appears that the scroller won't work if I try and put multiline strings into the array like this:


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 ?

zorba
02-20-2009, 12:38 AM
Ok, a quick visit to w3schools.com has taught me about using \ at the end of lines to break up a string, hence:


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) ?

ddadmin
02-20-2009, 05:51 AM
Yep on both counts. :) And you can always just backslash any quotations within your string, for example:


var phrase="My name is \"George\""