50 users online (0 members and 50 guests)  


  Results 1 to 6 of 6

Related

  1. Javascript Function    Forum: Javascript Forum
    Replies: 0
  2. how to stop javascript via another javascript    Forum: Javascript Forum
    Replies: 0
  3. Javascript function call    Forum: Javascript Forum
    Replies: 1
  1. #1
    noni's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2005
    Posts
    3

    Question Is it possible to stop a javascript function w/ other javascript code?

    Hello ppl!

    Can anyone help me out with this question?

    Is it possible to block/stop a javascript function w/ other javascript command? How?

    I got the following javascript code (it's an auto-adbox that apears - before the pages' <html> tag - every time the page w/ the code is loaded). I'd like to block/stop this code w/ other javascript code in the same page. Is it possible?

    Ps.: Unfortunetly I can't erase/delete the "auto-adbox code" due to function reasons.

    The "auto-adbox" code:

    <HEAD>
    <style type="text/css">
    #adsbox{
    position:absolute;
    align: center;
    left: 0;
    top: -600px;
    padding: 1px;
    z-index: 100;
    visibility:hidden;
    }
    </style>
    <script type="text/javascript"><!--
    var delay__time = 25;

    function showadsbox()
    {
    var ie=document.all && !window.opera;
    var dom=document.getElementById;
    iebody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body;
    objref=(dom)? document.getElementById("adsbox") : document.all.adsbox;
    var docwidth=(ie)? iebody.clientWidth : window.innerWidth;
    docheight=(ie)? iebody.clientHeight: window.innerHeight;
    var objwidth=objref.offsetWidth;
    objheight=objref.offsetHeight;
    objref.style.left=docwidth/2-objwidth/2+"px";
    objref.style.top= document.body.clientHeight -110;
    if (objref.filters)
    {
    objref.filters[0].duration=0.8;
    objref.filters[0].Apply();
    objref.filters[0].Play();
    }
    objref.style.visibility="visible";
    if (objref.style.MozOpacity) mozfadevar=setInterval("mozfadeads()", 90);
    else setTimeout("hideadsbox()", (objref.filters)? (delay__time+objref.filters[0].duration)*1000 : delay__time*1000);
    }

    function mozfadeads()
    {
    if (parseFloat(objref.style.MozOpacity)<1) objref.style.MozOpacity=parseFloat(objref.style.MozOpacity)+0.5;
    else
    {
    clearInterval(mozfadevar);
    setTimeout("hideadsbox()", (objref.filters)? (delay__time+objref.filters[0].duration)*1000 : delay__time*1000);
    }
    }

    // please NOTE function names and variables change every few months!
    // Making it NOT worth your efforts to hack this script!! Sorry.
    function hideadsbox()
    {
    objref.style.visibility="hidden";
    }

    function initads()
    {
    setTimeout("showadsbox()", 100);
    }
    if (window.addEventListener) window.addEventListener("load", initads, false);
    else if (window.attachEvent) window.attachEvent("onload", initads);
    else if (document.getElementById) window.onload=initads;
    // --></script>

    <html>
    ...then starts the page source code...

    Any help is welcome!

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hi, welcome to the forums.

    Whilst its an interesting question, I have to assume the ad is placed by your host in return for free hosting. It would be against your TOS I suspect to do what you want to do. If you don't show the ads, how can you expect to use the webspace?
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    noni's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2005
    Posts
    3
    Hi QuietDean!

    The problem is that, it's not a free webhost. It's an ad placed in all html pages by an encoded php file which I can't edit.

  4. #4
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Is the add placed by your host? And who is your host?
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  5. #5
    noni's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2005
    Posts
    3
    problem solved...

    thx

  6. #6
    colton22's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2006
    Posts
    1

    Re: Is it possible to stop a javascript function w/ other javascript code?

    Can you please post your code that broke the function where it was, in otherwords stoped the function after it was running?
    i am doing a task in my goverment class about campains and i am the web developer, i need to stop 4 functions in a row after they have started.
    thanks
    cotlon22 -



Tags for this Thread