I put the Google+ Share in my web site thru a txt file. Means pages (thru a javascript) reads the txt file and then put it in a certain place.
Everything goes well in my Default.aspx page.
When I want to surf in other pages (like “products”) I see all the links (which they works fine, but the Google+ share is not sawing.
I really don’t know if my question expressed right, that’s why I’m giving the web site http://www.panos-oliveoil.gr, for anyone wants to see from first hand.
I also put the google+ line:
<div class="g-plus" data-action="share"></div>
Separately in my “products.aspx”page and is NOT working as well.
The script I use is:
<div id="usefulliks" style="text-align:left; color:Black;">
<script type="text/javascript">
var doc = "useful_links.txt";
var path = "../pages/announce/";
var finallinks;
var txtLinksFile = new XMLHttpRequest();
txtLinksFile.open("GET", path + doc, true);
txtLinksFile.onreadystatechange = function () {
if (txtLinksFile.readyState === 4) { // Makes sure the document is ready to parse.
if (txtLinksFile.status === 200) { // Makes sure it's found the file.
finallinks = txtLinksFile.responseText.split("\n");
document.getElementById("usefulliks").innerHTML = finallinks;
}
}
}
txtLinksFile.send();
</script>
</div>
That script works fine for other files as well like “company_announce” in all pages.
and also it works fine in that particular txt file (regarding the other links).
I really can’t understand what is the error on it.
I say that because I’m not some specialist in javascript; in fact I’m a new learner.
Finally I discover that the Google+
<div id="Div1" xml:lang="en" runat="server" class="g-plus" data-action="share"></div>
Works ONLY when the Default.aspx page is active…
Is there anyone knows why is that?
Finally is that… The Google+ works ONLY when the Default.aspx is ACTIVE and not in any other page.
I put it on my Footer in Master page and it works ONLY when the Default page is active….