Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Google parsing javascript

Including external .js files



9:55 pm on Nov 30, 2002 (gmt 0)

10+ Year Member

I've just checked the google cache of one of my sites and noticed that google has parsed an external js file in the last update (this week).

Its a simple document.write javascript and the output is showing up on the cached page.

Another site that uses frames (yep I know) has a javascript that writes a frameset if the page is opened outside of its frameset - the cache of this is showing up as a blank page, as if it was an html frameset.

Is this new or did I just miss it until now?

And what will google do with javascript redirects - the kind that check for a frameset and redirect if its not there?

If it indexes the frameset it redirects to, I am looking at many hours of convincing frame-loving clients to ditch them - please tell me it isn't so :(


9:59 pm on Nov 30, 2002 (gmt 0)

WebmasterWorld Senior Member heini is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Hmm, there is a second report on a problem with Google and JS in this update:


9:29 pm on Dec 1, 2002 (gmt 0)

10+ Year Member

Google does not parse the JS. In Google's cache, your page is as it is. Of course, all the JS commands are in there also. It's your browser that parses the JS. If there is an external JS file, your browser gets it from your server. Normally, the external JS file is linked relatively and, therefore, there is a base tag in the little bit of HTML that Google puts into the cache pages.

Regarding the cache of the frames page, did you disable JS in your browser before you checked it?


5:24 pm on Dec 2, 2002 (gmt 0)

10+ Year Member


Are you talking about this:

if (top.location = location){top.location = "http://www.url_to_framset"}

This used to work fine for us on Google (last checked maybe 3 weeks ago). But now pages with this code go into an infinite loop of reloading.

I am really getting fed up with Google - especially after reading:

Anyone any ideas about getting round this?



7:24 pm on Dec 4, 2002 (gmt 0)

10+ Year Member

Just noticed my deliberate mistake [blush]

top.location = location
should be:
top.location == location

Can't believe it still catches me out!


4:39 pm on Dec 5, 2002 (gmt 0)

10+ Year Member

pretty much, except i use

if (window == top)

I have switched from doing a redirect to writing the frameset into the current page, that way the page isnt actually redirecting. Not sure if it matters too much at the mo, but it might someday soon.

When is the infinite loop happening, in the google cache page? I can't see how google could affect the operation of the script like that, but I could be wrong.

BTW the == gets me too, too much jumping from asp to php ;)


5:04 pm on Dec 5, 2002 (gmt 0)

10+ Year Member

The infinite loop was my "=" and not "=="

I am also switching sites over to loading orphaned pages into a framset (rather than just redirecting). If it helps, the .js and .html code is below:

function loadFrameset(){
passpage = document.URL
if (top.location == self.location) {
top.location.href="master.htm?" + passpage

<script language="JavaScript" type="text/javascript">
origURL = parent.document.URL

document.write('<FRAMESET rows="58,*" frameborder="NO" border="0" framespacing="0">\n')
document.write(' <FRAME name="topFrame" src="pages/bsa/new_top.htm" scrolling="NO">\n')

if (origURL.indexOf('?')!= -1){
contentURL = origURL.substring(origURL.indexOf('?')+1, origURL.length)
document.write(' <FRAME name="mainFrame" scrolling="AUTO" noresize src="' +contentURL+ '">')
document.write(' <FRAME name="mainFrame" scrolling="AUTO" noresize src="pages/bsa/home.htm">')


HTH. Brian


7:14 pm on Dec 5, 2002 (gmt 0)

10+ Year Member


I am doing something pretty similar, except that the frameset code is written between the head and body of the current page, rather than redirecting to a master.htm type page.

I won't post the code, don't want to get told off for turning this into a js forum :)

If you're interested, sticky me and I'll send you a copy.


7:53 pm on Dec 5, 2002 (gmt 0)

10+ Year Member

I am really getting fed up with Google - especially after reading:

What's wrong with this?


11:04 am on Dec 6, 2002 (gmt 0)

10+ Year Member


Most of it is fine - they are legitimately trying to get rid of some of the bad practices that exist in our industry - and I agree.

However some of the points are extremely naive and are damaging in themselves. For example see the sections:

Talk to many SEOs...
Make sure you're protected legally
If you feel you were deceived by an SEO...
and most contentious of all, their piece on Doorway sites/pages


[edited by: Marcia at 1:28 pm (utc) on Dec. 6, 2002]
[edit reason] Please see stickymail [/edit]


3:59 pm on Dec 6, 2002 (gmt 0)

10+ Year Member

The doorway page paragraph is a bit heavy, but unfortunately it is often true.

I know of one company who paid 1,000 for a bunch of these doorways last year - they are all part of a link network with the seos other clients, all have pr0 and the pr of the main site has dropped.

I have warned them several times, but they have just paid out for a load more (in an attempt to increase their falling visitor count) - I give up.

Anyway, does it really matter what google says on that page? How many people are going to read it anyway, apart from seos that is?


4:14 pm on Dec 6, 2002 (gmt 0)

10+ Year Member

As this thread is diverging - I have set up a new thread relating to the "Google SEO comments"...

Featured Threads

Hot Threads This Week

Hot Threads This Month