Welcome to TalkGraphics.com
Page 1 of 4 123 ... LastLast
Results 1 to 10 of 39
  1. #1

    Default Can I add a script in a footer

    Can I add a (code) script that I'd like to use as a footer for each page on my website?

    If so, can you tell me how to do it?

    Thanks,
    Sue

  2. #2
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,862

    Default Re: Can I add a script in a footer

    Quote Originally Posted by SueB View Post
    Can I add a (code) script that I'd like to use as a footer for each page on my website?
    If so, can you tell me how to do it?
    Thanks, Sue
    Sue, easier to explain if you advise what result you are after or a reference to the code itself.

    There is no simple approach but for a single instance, you would create a Placeholder shape and then add the code to its body.
    Unfortunately, cloning this across all pages will probably not work if a HMTL ID reference is used; it needs to be a Class reference.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  3. #3

    Default Re: Can I add a script in a footer

    It's a copyright script that adds the year each year without having to go into each one and change it.

    Here it is: <p>Copyright © 2016-
    <SCRIPT LANGUAGE="JavaScript">
    <!--- Hide from old browsers
    document.write(y0);
    // end hiding --->
    </SCRIPT>

  4. #4
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,862

    Default Re: Can I add a script in a footer

    Quote Originally Posted by SueB View Post
    It's a copyright script that adds the year each year without having to go into each one and change it.

    Here it is: <p>Copyright © 2016-
    <SCRIPT LANGUAGE="JavaScript">
    <!--- Hide from old browsers
    document.write(y0);
    // end hiding --->
    </SCRIPT>
    There will be a method somewhere that add the current year to the variable y0; do you have that?

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  5. #5

    Default Re: Can I add a script in a footer

    I think this is all I have and it works

  6. #6
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,862

    Default Re: Can I add a script in a footer

    Quote Originally Posted by SueB View Post
    I think this is all I have and it works
    Sorry, it doesn't and it can't.
    Somewhere in your header, you will have a piece of code to get today's date...

    Acorn

    P.S. I have added your code to a Placeholder and run it; all you get is "Copyright © 2016-".
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  7. #7

    Default Re: Can I add a script in a footer

    Sorry... maybe this is it..hope this helps you, help me
    <div id="footer"><SCRIPT LANGUAGE="JavaScript">
    <!--

    //Script created by Ronny Drappier, http://sipreal.com
    //Visit http://javascriptkit.com for this script

    today=new Date();
    y0=today.getFullYear();

    // end hiding --->
    </SCRIPT>

    <center>Copyright © 2008-<SCRIPT LANGUAGE="JavaScript">
    <!--- Hide from old browsers
    document.write(y0);
    // end hiding --->
    </SCRIPT>

    I also add a no right click script...
    I think this is it...
    </div><script language=JavaScript>
    <!--

    //Disable right mouse click Script
    //By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
    //For full source code, visit http://www.dynamicdrive.com

    var message="Function Disabled!";

    ///////////////////////////////////
    function clickIE4(){
    if (event.button==2){
    alert(message);
    return false;
    }
    }

    function clickNS4(e){
    if (document.layers||document.getElementById&&!docume nt.all){
    if (e.which==2||e.which==3){
    alert(message);
    return false;
    }
    }
    }

    if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=clickNS4;
    }
    else if (document.all&&!document.getElementById){
    document.onmousedown=clickIE4;
    }

    document.oncontextmenu=new Function("alert(message);return false")

    // -->
    </script>
    Last edited by SueB; 03 April 2017 at 07:06 PM. Reason: added other script I would like to add

  8. #8
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,862

    Default Re: Can I add a script in a footer

    A better approach might be along the lines of https://www.talkgraphics.com/showthr...in-placeholder.

    Create a text box with text "Copyright © 2016"
    To its Placeholder HTML code(body), insert:
    <span>Copyright &copy; 2016-<script>new Date().getFullYear()>2006&&document.write(new Date().getFullYear());</script></span>
    This can be repeated on all pages as a footer-locked textbox. Yopu can alter the font, size and colour of the textbox to round it all off.

    Don't bother with disabling right clicks; that way lies madness.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  9. #9

    Default Re: Can I add a script in a footer

    I'll have to learn the "placeholder" stuff. New to this.
    Can you tell me more details how to do it? Read the linked post..but still unsure. I'm guessing what you mean "footer-locked textbox" is just that, a textbox that is looked and duplicated on all pages?

    I know there is controversy about the right click...I'd rather try to disable it for those that don't know any better. Artwork is important to try to save from being stolen. Watermarks detract from the prettiness of it but I do that also. Most of my audience is not computer savvy.

    Any way to disable the right click that you care to share?

  10. #10
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,512

    Default Re: Can I add a script in a footer

    A placeholder is usually just a simple rectangle positioned where you want something to appear and in this case designated as a Footer.

    Select the rectangle, then select Placeholder from the Web Properties fly out on the Infobar.

    Click Body and paste the script.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	placeholder.png 
Views:	80 
Size:	43.3 KB 
ID:	116742  

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •