Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Asynchronous JavaScript to speed webpage


DAVID3733

Recommended Posts

I am trying the bring down the speed of loading on my website, one of the things i see the Plus 1 google social bookmark use is Asynchronous Javascript and it loads at the same time as other things so even though it is a bit slow the webpage is not effected.

 

So i wanted to use the same principle for my site seal which always takes longer to download than i would like

 

this is what i have in my footer for the SSL seal

 

	    <script language="Javascript" type="text/javascript"> SiteSeal("https://seal.networksolutions.com/images/basicrecblue.gif", "NETSB", "none");</script>

 

which works fine but i wanyed to make it quicker

 

the following pulls up a undefined error although it does not break the page, nor is it quicker becuase of the undefined error

 

<script type="text/javascript">   (function() {	 var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;	 po.src = SiteSeal("https://seal.networksolutions.com/images/basicrecblue.gif", "NETSB", "none");</	 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);   })(); </script>

 

does anybody know where i am going wrong with this, any pointers would be greatfully recieved

 

Thank you

 

 

david

David

Link to comment
Share on other sites

I'm guessing the first ( is not needed, and the last () neither

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

and what is there in the middle in front of

 

var s

 

 

?

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

if you write it out on individual lines, it is much easier to read for us.

Looks like the end ]) is strange too

 

 

BTW still guessing ...

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Here is the code again in lines

 

<script type="text/javascript">   
(function() {  var po = document.createElement('script');
po.type = 'text/javascript';
po.async = true;	    
po.src = SiteSeal("https://seal.networksolutions.com/images/basicrecblue.gif", "NETSB", "none");
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);   })();
</script>

thank you

David

Link to comment
Share on other sites

I had a couple of problems on the page which i think i got rid of

 

I am now getting the error

 

document.getElementByID(...) is null

 

The script is loading the file, but giving a error and not loading Asynchronous in testing

 

this is the code i now have

 

(function() {
   var s = document.createElement('script');
   s.type = 'text/javascript';
   s.async = true;
   s.src = (SiteSeal('https://seal.networksolutions.com/images/basicrecblue.gif', 'NETSB', 'none'));
   var x = document.getElementsByTagName('script')[0];
   x.parentNode.insertBefore(s, x);
})();
</script>

 

Thank you for looking

David

Link to comment
Share on other sites

there is no

document.getElementByID

 

in this piece of code , so to me sounds like it is someother script

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...