Adding HTML codes or Javascript to pages
Adding HTML
& Javascript to Pages
The editor is designed to clean up
code and remove code that is not part of the page. If the code
you are adding to the page has part of the code commented out,
that part of the code or script will be removed when you save the
page. You will need to understand which part of the code or
script is just a comment and what needs to remain on the page for
the code to work correctly.
HTML Comments -
An HTML comment is a section of the source code that is not
displayed or meant to be read by the search engines. It is a note
or comment that the webmaster uses to explain what part of the
page or what element should be at that point in the page.
For example,
<!-- Start Add Code Here -->
<!-- End Add Code Here -->
To streamline page loads and help
with SEO ranking, we remove those comments when the page is
published to the web.
In many cases, source code writers
use comment tags to hide elements from the search engines in an
effort to trick them and get a higher rank. It does not work,
they know the trick and it counts against the page.
Trying to mask or conceal what a
script or html source is doing will trick our editor and the
comments will be removed. If any of the important parts are
removed, the code wont work. Therefor you must remove any comment
tags that contain code that is needed in the page.
For example, when adding Google ad
sense to pages we get a code from google that looks like this:
<script type="text/javascript"><!--
google_ad_client = "pub-0000000000000000";
google_alternate_color = "FAFBF5";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_channel ="0000000000";
google_ad_type = "text";
google_color_border = "FAFBF5";
google_color_bg = "FAFBF5";
google_color_link = "0000FF";
google_color_url = "0000FF";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="https://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
Notice the comment tags shown
above in red. If the entire code is pasted ito the online page
editor, everything between the tags will be removed.
Therefore you will need to remove
those red comments so the code would look like this:
<script type="text/javascript">
google_ad_client = "pub-0000000000000000";
google_alternate_color = "FAFBF5";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_channel ="0000000000";
google_ad_type = "text";
google_color_border = "FAFBF5";
google_color_bg = "FAFBF5";
google_color_link = "0000FF";
google_color_url = "0000FF";
google_color_text = "000000";
</script>
<script type="text/javascript"
src="https://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
The code will now work correctly
and function as it is intended.
Follow the same rules when you are
adding HTML code from outside sites that may use comments to show
you how to add the code and not necessily that the comments are
part of the codes function.
For example this code:
<!-- Start Add Code Here -->
<a href="https://somesite.com/add-links.php">Somelink</a>
<!-- End Add Code Here -->
Should read:
<a href="https://somesite.com/add-links.php">Somelink</a>
By removing the comments or
comment tags your code will not be altered when the page is saved.
If you don't understand what the
code should have in it, contact the person that has provided the
code and ask for the code with the comments removed.
|