ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Disabling Expression Engines javascript email address encoding

August 03, 2009 11:19am

Subscribe [3]
  • #1 / Aug 03, 2009 11:19am

    Adam Dorsey

    1439 posts

    I was wondering if it is possible to disable Expression Engine’s javascript encoding of email addresses. I have a client who doesn’t have javascript enabled (imagine that) so all of the email addresses in the site’s entries display as…

    (JavaScript must be enabled to view this email address)


    The funny thing is, that is some places it isn’t encoding the email addresses at all. I have wrote out the entire link, like so:

    <a href="mailto:[email protected]">Click here to email adam</a>

    ...but it is still replacing it with some javascript like this:

    //<![CDATA[
    var l=new Array();
    var output = '';
    l[0]='>';l[1]='a';l[2]='/';l[3]='<';l[4]=' 109';l[5]=' 111';l[6]=' 99';l[7]=' 46';l[8]=' 114';l[9]=' 101';l[10]=' 108';l[11]=' 108';l[12]=' 105';l[13]=' 77';l[14]=' 101';l[15]=' 110';l[16]=' 111';l[17]=' 101';l[18]=' 109';l[19]=' 105';l[20]=' 83';l[21]=' 64';l[22]=' 110';l[23]=' 111';l[24]=' 105';l[25]=' 116';l[26]=' 97';l[27]=' 116';l[28]=' 108';l[29]=' 117';l[30]=' 115';l[31]=' 110';l[32]=' 111';l[33]=' 67';l[34]=' 101';l[35]=' 101';l[36]=' 114';l[37]=' 70';l[38]='>';l[39]='\"';l[40]=' 109';l[41]=' 111';l[42]=' 99';l[43]=' 46';l[44]=' 114';l[45]=' 101';l[46]=' 108';l[47]=' 108';l[48]=' 105';l[49]=' 77';l[50]=' 101';l[51]=' 110';l[52]=' 111';l[53]=' 101';l[54]=' 109';l[55]=' 105';l[56]=' 83';l[57]=' 64';l[58]=' 110';l[59]=' 111';l[60]=' 105';l[61]=' 116';l[62]=' 97';l[63]=' 116';l[64]=' 108';l[65]=' 117';l[66]=' 115';l[67]=' 110';l[68]=' 111';l[69]=' 67';l[70]=' 101';l[71]=' 101';l[72]=' 114';l[73]=' 70';l[74]=':';l[75]='o';l[76]='t';l[77]='l';l[78]='i';l[79]='a';l[80]='m';l[81]='\"';l[82]='=';l[83]='f';l[84]='e';l[85]='r';l[86]='h';l[87]='a ';l[88]='<';
    for (var i = l.length-1; i >= 0; i=i-1){ 
    if (l[i].substring(0, 1) == ' ') output += "&#"+unescape(l[i].substring(1))+";"; 
    else output += unescape(l[i]);
    }
    document.getElementById('eeEncEmail_UjcCSoRZWa')[removed] = output;
    //]]>

    I would love to just disable that feature entirely. Somewhere in the admin section or preferences perhaps? I can’t seem to find it.

    Thanks in advance,
    Adam

  • #2 / Aug 03, 2009 12:36pm

    Ingmar

    29245 posts

    You’ll need to turn off “Automatically turn URLs and email addresses into links?” here:  Admin > Weblog Administration > Weblog Management > Edit Preferences.

  • #3 / Aug 03, 2009 12:40pm

    Adam Dorsey

    1439 posts

    That was it.

    Thanks!

  • #4 / Aug 03, 2009 12:55pm

    Ingmar

    29245 posts

    My pleasure, as always 😊 Please don’t hesitate to post again as needed.

  • #5 / Dec 15, 2009 4:37pm

    jdgiotta

    12 posts

    Is there anyway do this per entry? I don’t want to loose the feature, but it’s playing havoc on my XML feeds.

  • #6 / Dec 15, 2009 4:38pm

    Ingmar

    29245 posts

    I am afraid there isn’t, no. You could turn it off globally, though, and then use

    <pre><code>
    {[email protected]}
    [/url]

    when and where needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases