Forum Moderators: open
This Q is related to a javascript script called geodirection. Can be found at:
[geobytes.com...]
However, this Q is more general in that it is about how to speed javascript execution.
GeoDirection is a free javascript that dynamically redirects internet surfers based on their geographic location.
I am having some problems with geodirection in terms of the speed at which it acts.
Basically - I have a default web page for one geographical area, geographical area A. This web page being, page A.
Surfers from geographical area B are transferred to a different web page, away from the default. This web page being page B.
This works - however, it takes quite a while for the transfer to take place. People from area B can see the default web page, A, whilst they are waiting to be transferred to web page B.
This is bad.
POSSIBLE SOLUTION?
Is there any way that I can optimise the code such that the transfer protocol is executed before the text and images of website A, the default web page, is displayed?
SO THE GENERAL Q IS - HOW CAN I MAKE IT SO THAT THE JAVASCRIPT IS EXECUTED BEFORE THE HTML. THE HTML IS ONLY EXECUTED AFTER THE JAVASCRIPT HAS FINISHED?
I have been putting the javascript in the <head> <head> section of the HTML file.
Would be ever so grateful for some help with this.
You need to use server-side technologies (eg. PHP or mod_rewrite) to avoid this.