• FireFlyWebs

    (@fireflywebs)


    I have this code below, on a page, in the text mode of the editor (using Page Builder – so it’s a classic editor). This is to create a simple popup bubble with simple text in it. It works fine when originally added and tested, but any and all edits to the page content strips the function code part. onclick=”popFunction1()”

    The full code is:

    <span class=”popup” onclick=”popFunction1()”><span class=”pop-link”>1534</span> <span class=”popuptext” id=”link1534″>

    Can you advise? Is there a work around to protect it from being stripped?

    I have the function scripts for these simple popups in a header plugin, and that is working correctly. I think it’s the editor that is stripping the code.

Viewing 4 replies - 1 through 4 (of 4 total)
  • threadi

    (@threadi)

    Are you talking about the Block Editor? There is a code editor there. I would advise against changing the source code there. This removes elements that are not permitted.

    It would be better to use the HTML code block in the Visual Editor to insert this code.

    Thread Starter FireFlyWebs

    (@fireflywebs)

    Sorry, I did answer a week ago, but it didn’t end up here for some reason. No I don’t use blocks. This is done in PageBuilder (SiteOrigin) which has retained the classic editor. But it doesn’t matter in that regard since Elementor also strips the code.

    I have a simple pop up and it calls on a php script in the header, (or more specifically, which resides in a plugin WP Headers And Footers) and that is all stable.

    This is a very simple and text basic popup that is triggered on the link click. I cannot find a plugin that isn’t all about big flashy popups and ads so I found simple html code. The popup looks like this when you click the link….https://www.fireflywebs.ca/wp-content/uploads/2024/05/popupView.jpg (Simple white box with text which hides when you click the box)

    This is an example of the code blow. The bolded popFunction is what gets stripped out. I have several on the page, and the popFunction is stripped from all of them whenever I come back to the page and do an edit anywhere on the page, and then resave. Then function part of the code is stripped out, so the popup no longer works of course.

    <span class=”popup” onclick=”popFunction1()”><span class=”pop-link”>1534</span> <span class=”popuptext” id=”link1534″>

    (The popFunction calls to the php script ID in the header)

    It’s similar to this https://www.w3schools.com/howto/howto_js_popup.asp .

    The question is how to prevent the code from being stripped out.

    I still can’t quite follow you, partly because I still don’t know your project at all.

    I assume that you use SiteOrigin AND Elementor. You are inserting this popup code, which is provided by another plugin as HTML code, into an editor. In which one then? Elementor or SiteOrigin? Then you save the content. If you open the editor again afterwards, the HTML code is gone. Is that correct?

    Either way, I see the problem more in the editor you are using. Whichever one it is, I would recommend that you contact their support forum for clarification.

    Thread Starter FireFlyWebs

    (@fireflywebs)

    If I use either Elementor or SiteOrigin to create the page, the code is stripped.

    The entire html code is not gone, just the function piece.

    Will try to contact site origin.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Code being stripped’ is closed to new replies.