Friday, April 05, 2019

Embedding JS-CSS in a Webpage Template

Now many third part scripts like Stats, Ads, Videos, Gadgets and Ajax elements are available for embedding in the template of a service or community-network template page.

Average user cannot tackle code snippets and inadvertently introduce errors, while adding the code to his template html source.

More important is that this snippets will change syntax as the webapps evolve and the service api changes or even new web standards.

Embedding JS-CSS in a Webpage Template

It may be best to make this snippet invisible to users and available to programmers if needed. Even the code coming on the browser client html makes the page cluttered and there is a bandwidth element too.

A new HTML tag may help clean the clutter and leave the snippet at the server. It is similar to embedding images ..

<xgz src="http://service3-api.net/ads-kb.gz" />

The xgz tag is for gz compressed xhtml code analogous to "img src" for embedding images. The gz file has CSS-JS and XHTML code that is current to that service and account.

The Browser decompresses the gz and renders the page and effects as designed. The Browser View source just shows the xgz tag for every code-embed. Expanding the element gives more details. As this code is at host, it cannot be modified or tampered by any user.

The best part of this is, some code gz can be password protected so the code wont unzip or render for user browsers that are not logged in. The password protection of code gz can also protect the code to some extent. Which may be the DHTML or AJAX IP of creative web designers.

Posted first around 2007 updated 2009

No comments:

Post a Comment

delabs Tube



More at delabs Tube