Removing javascript in show_join

Home Forums Scripts Enthusiast Removing javascript in show_join

This topic contains 7 replies, has 3 voices, and was last updated by  Jem 1 year, 11 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #13900

    Cozza
    Participant

    I’m currently in the process of completing a fanlisting, but have been faced with an obstacle — the javascript I’m using for the fanlisting refuses to load the join page completely due to the the javascript that’s present in the show_join page.

    Is there any way to modify the following code to remove the javascript, but keep the variables (which are used in the rest of the file) intact?

    if( $show_form ) {<br />
    $cutup = explode( '@', $info['email'] );<br />
    $email_js = '<script type="text/javascript">' . "rn<!--rn" .<br />
    "jsemail = ( '$cutup[0]' + '@' + '$cutup[1]' ); rn" .<br />
    "document.write( '<a href="mailto:' + jsemail + '">email me</' + " .<br />
    "'a>' );rn" . ' -->' . "rn" . '</script>';</a>

    This modification will be used for one fanlisting only (just give the file a dif name to include), so I’m not too worried about receiving spam.

    Oh — and I wasn’t sure whether you needed to see the whole show_join file. The code above is the only script tag in it, though.

    Thanks in advance!

    #14683

    amphigory
    Participant

    The reason that page isn’t showing up is likely because of this line:

    "document.write( '<a href="mailto:' + jsemail + '">email me</' + "

    You need to escape the double quotes in the anchor HTML:

    "document.write( '<a href="mailto:' + jsemail + '">email me</' + "

    #14684

    Cozza
    Participant

    Thanks, amphigory — previously the title of the webpage was not loading, now it is. However, the issue still remains. I think it’s just clashing with the pre-existing javascript on my page. So if there’s any way to remove it, I’d be grateful! :)

    #14685

    amphigory
    Participant

    Well… I’m not at all familiar with Enthusiast so I don’t know if those are required variables. But, can you set $email_js = '';?

    #14686

    Cozza
    Participant

    Omg! I think I just about fainted when I saw it working!

    Thank you so much! I removed the script tags from between the ‘s as you said, and it worked like a charm! ? 8D

    Just an added note to anyone else who may read this thread having the same issue – once you remove the script tags you’ll need to modify the mailto: parts of the document. ^^

    Thanks again, amphigory!

    #14687

    Jem
    Keymaster

    Please bear in mind that this removes the JavaScript “protection” from email addresses listed on the members page. I think JS protection is all but useless but others may desire it, so you may wish to put a note on your fanlisting’s join page to warn them of the modification, as a courtesy? Just a thought :)

    #14688

    Cozza
    Participant

    ah yes – I’ve already modified that fl’s template to completely remove the option of displaying email addresses ^^

    #14689

    Jem
    Keymaster

    Even better :)

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.