WordPress.org

Ready to get started?Download WordPress

Forums

Stripping SRC from SCRIPT tags (10 posts)

  1. shambala
    Member
    Posted 8 years ago #

    I'm trying to include a flash file via javascript. This would work fine (tried and tested) except that WordPress is stripping the SRC from my SCRIPT tags. What's going on?

    Here is my code:
    <script language="javascript" src="http://www.somesite.com/somepage.php?SomeID=6"></script>

    And WordPress turns it into:
    <script language="javascript" />

    I installed the Text Control plugin but it lacks any directions on what all the weird modes mean, and after trying a few of them, see no change to the stripping of the src="" part. Help!

  2. moshu
    Member
    Posted 8 years ago #

    See if this helps: Using_Javascript.

  3. shambala
    Member
    Posted 8 years ago #

    Thanks for the reply, but that page doesnt help. Those any many other sites on using javascript in WordPress say the way to do it is to include something like the following:

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

    When that is precisely my problem - the src="/scripts/emailpage.js" is being stripped out.

  4. Samuel B
    moderator
    Posted 8 years ago #

    It's best to enter the code manually in the basic editor - do not c & p from anything but Notepad or similar.

  5. shambala
    Member
    Posted 8 years ago #

    I was copying it from a text editor. I've also tried manually inputting it. In either case, the src gets stripped out.

    I think it might be TinyMCE (the javascript interface used by WordPress for all entries) that might be stripping the tag but I'm not sure.

  6. Yngwin
    Member
    Posted 8 years ago #

    Does it work when you disable the Text Control plugin or when you turn off the rich text editor?

  7. shambala
    Member
    Posted 8 years ago #

    I got the TextControl plugin to try to get it to work. So it's stipped out with or without it.

    How do I turn off the rich text editor?

  8. shambala
    Member
    Posted 8 years ago #

    Ping!

    Does anybody know how to turn off the rich text editor?

  9. Samuel Wood (Otto)
    Tech Ninja
    Posted 8 years ago #

    Go to the Users page and turn it off at the bottom of the screen.

    Or just click the HTML button in the editor to be able to directly edit the text without the editor's help.

  10. mahalie
    Member
    Posted 8 years ago #

    Whoohoo! I was getting very frustrated with this exact problem. Followed CODEX instructionas Using_Javascript and my src was getting stripped in addition to my line endings getting lost, even while using TextControl.

    I was entering the code in the text editor popup provided by the HTML link on the rich editor. As soon as I unchecked 'Use the visual rich editor when writing' in my user profile everything worked as expected.

    Screw the WYSIWYG, I'm a control freak I guess.

Topic Closed

This topic has been closed to new replies.

About this Topic