Results 1 to 6 of 6
  1. #1
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,414
    Thanks
    33
    Thanked 195 Times in 175 Posts
    If I remember correctly, Jefferson and/or Joe helped me well over a year ago to extract the information from the Javascript code generated by the EnkoderForm email obfuscation mechanism and bundle a number of these functions into a file.

    Let me say a bit more.

    I have a file called (say) Stuff.js which contains functions of the form

    function NameOne()
    {var kode=
    <snip several lines>
    ;}

    function NameTwo()
    {var kode=
    <snip several lines>
    ;}


    and so on.

    In my HTML webpage I have, between <head> and </head>

    <script src="Stuff.js" type="text/javascript"></script>

    and within the main body of the webpage I call the functions to give the names/email addresses

    Please contact <script type="text/javascript">NameOne();</script>
    or <script type="text/javascript">NameTwo();</script>

    My question is: How can I put a <noscript> / </noscript> pair into each function in the Stuff.js file, so that, if the user has scripting turned off by some means, they will see something like
    NameOne's email address is not visible unless you turn scripting on.

    Hope that makes (some) sense...

    Thanks
    BATcher

    Time prevents everything happening all at once...

  2. #2
    5 Star Lounger
    Join Date
    Apr 2003
    Location
    Hampshire, United Kingdom
    Posts
    602
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='BATcher' post='774082' date='07-May-2009 12:52']If I remember correctly, Jefferson and/or Joe helped me well over a year ago to extract the information from the Javascript code generated by the EnkoderForm email obfuscation mechanism and bundle a number of these functions into a file.

    Let me say a bit more.

    I have a file called (say) Stuff.js which contains functions of the form

    function NameOne()
    {var kode=
    <snip several lines>
    ;}

    function NameTwo()
    {var kode=
    <snip several lines>
    ;}


    and so on.

    In my HTML webpage I have, between <head> and </head>

    <script src="Stuff.js" type="text/javascript"></script>

    and within the main body of the webpage I call the functions to give the names/email addresses

    Please contact <script type="text/javascript">NameOne();</script>
    or <script type="text/javascript">NameTwo();</script>

    My question is: How can I put a <noscript> / </noscript> pair into each function in the Stuff.js file, so that, if the user has scripting turned off by some means, they will see something like
    NameOne's email address is not visible unless you turn scripting on.

    Hope that makes (some) sense...

    Thanks[/quote]

    You would have to put the noscript tags in the body, where you call the NameOne etc. functions:

    Please contact <script type="text/javascript">NameOne();</script><noscript>NameOne's email address is not visible unless you turn scripting on</noscript>
    or <script type="text/javascript">NameTwo();</script><noscript>NameTwo's email address is not visible unless you turn scripting on</noscript>
    Waggers
    If at first you do succeed, you&#39;ve probably missed something.

  3. #3
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,414
    Thanks
    33
    Thanked 195 Times in 175 Posts
    [quote name='Waggers' post='774086' date='07-May-2009 13:42']You would have to put the noscript tags in the body, where you call the NameOne etc. functions:[/quote]
    I was aiming to avoid this, if at all possible, because the point of the function(s) was to code the lengthy bits once...
    BATcher

    Time prevents everything happening all at once...

  4. #4
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've used server side scripting for this sort of thing. Javascript is used to generate the html, which is then delivered as html with little client side scripting at all.

    So for my website, a page, for instance like http://belconnen-subs.com.au/Board1.asp has source code on the server, with an Include file of javascript functions (SSI- Server Side Include?), which looks like[codebox]<html lang="en">
    <head>
    <title>Subway Belconnen- The Signboard</title>
    <LINK REL=StyleSheet HREF="style.css" TYPE="text/css" MEDIA=screen>
    <%@ language="javascript"%>

    <%
    var index;
    var pictureList = new Array(
    '24hr Chinese',
    'Abbreviation',
    'Accountant',
    'Acronyms',
    'Advice',
    'Alarm Clock',
    'Alarm Clocks',
    'Alcohol',
    'Alimony',
    'Ambiguity',
    'Ambivalent',
    'Amnesia',
    'Amnesia 2',
    'Apple',
    'April fools',
    'Archery',
    'Are you wise',
    'Army Dentists'
    );
    writeMeta("Signboard Page 1");
    writePicList(pictureList);
    %>
    <script src="showpic.js"></script>
    </head>
    <body background="bglogo.gif" onload="showPicture(0);">
    <%
    writeNavigation("Signboard");
    writeBoardLinks(1); //Current page number
    writeAllPics();
    %>
    </body>
    </html>
    [/codebox]

    The Javascript generates code depending on which page is showing. If I change the look and feel of the entire website, I only have to do it in one place.

    A typical but of code from the Include code is like this. If the link for the current page is being displayed I show the page number in bold with no hypertext; if it's not the current page I show the page as a hyperlink[codebox] if (pageNum==thisPage)
    {Response.Write('<td>' + thisPage + '</td>');}
    else
    {Response.Write('<td>' + thisPage + '</td>');}
    [/codebox]
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  5. #5
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post
    [quote name='BATcher' post='774088' date='07-May-2009 13:56']I was aiming to avoid this, if at all possible, because the point of the function(s) was to code the lengthy bits once...[/quote]

    Gosh, I remember the thread well it was quite an interesting one


    This is quite a good resource which may allow you to customise your page

    http://dev.opera.com/articles/view/replaci...-accessible-un/
    Jerry

  6. #6
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,414
    Thanks
    33
    Thanked 195 Times in 175 Posts
    [quote name='Jezza' post='774211' date='07-May-2009 23:50']This is quite a good resource which may allow you to customise your page
    http://dev.opera.com/articles/view/replaci...-accessible-un/[/quote]
    Thanks, Jerry - I shall read it in a quiet hour...
    BATcher

    Time prevents everything happening all at once...

Posting Permissions

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