Here is the script ( floater layers). It show "{global_content name='footer'}" instead of content of the "footer". How do I modify it?
-------------------------
lastScrollY=0;
function ad(){
var diffY;
if (document.documentElement && document.documentElement.scrollTop)
diffY = document.documentElement.scrollTop;
else if (document.body)
diffY = document.body.scrollTop
else
{/*Netscape stuff*/}
//alert(diffY);
percent=.1*(diffY-lastScrollY);
if(percent>0)percent=Math.ceil(percent);
else percent=Math.floor(percent);
document.getElementById("ad1").style.top=parseInt(document.getElementById
("ad1").style.top)+percent+"px";
document.getElementById("ad2").style.top=parseInt(document.getElementById
("ad1").style.top)+percent+"px";
lastScrollY=lastScrollY+percent;
//alert(lastScrollY);
}
ad1code="{global_content name='footer'}"
ad2code=""
document.write(ad1code);
document.write(ad2code);
window.setInterval("ad()",1);
-------------------
How to use or call tags ( or global content blocks) in Javascript?
-
Pierre M.
Re: How to use or call tags ( or global content blocks) in Javascript?
Hello madaha,
otherwise I've missed something, calling a UDT or a GCB from javascript is nonsense : the tag/bloc engine is on the web site and the script is inside the browser. Browser side scripts messes things after the UDT and GCB have been called/rendered.
Pierre M.
otherwise I've missed something, calling a UDT or a GCB from javascript is nonsense : the tag/bloc engine is on the web site and the script is inside the browser. Browser side scripts messes things after the UDT and GCB have been called/rendered.
Pierre M.
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: How to use or call tags ( or global content blocks) in Javascript?
Pierre is correct
GCB's and UDT's etc. are 'server side' scripts, not 'client side'.
If, youre doing some ajaxy thing and want to call a GCB or a UDT via XMLHTTP and then replace the contents of a DIV with the results of that call, well we can help with that.
But, by a quick scan of the javascript below that's not what you're tryiing to accomplish.
GCB's and UDT's etc. are 'server side' scripts, not 'client side'.
If, youre doing some ajaxy thing and want to call a GCB or a UDT via XMLHTTP and then replace the contents of a DIV with the results of that call, well we can help with that.
But, by a quick scan of the javascript below that's not what you're tryiing to accomplish.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
