WordPress.org

Ready to get started?Download WordPress

Forums

Javascript code to HTML code (6 posts)

  1. Uendi
    Member
    Posted 8 months ago #

    Hi

    Is there any way to convert Javascript code to HTML ?

    Thanks.

  2. Sleneau
    Member
    Posted 8 months ago #

    The short answer is no.

    Javascript and HTML are two very different technologies.

    HTML is a markup language meant to describe to a browser how the information on a web page is to be structured. Javascript is a scripting language handles interactivity, and can dynamically change the structure, appearance (by changing element styles), and even content of an HTML page. It can animate element, delete them, collect and process data, you name it.

  3. Uendi
    Member
    Posted 8 months ago #

    Thanks for your prompt reply.

    My problem is the merchant give me a javascript code and I am wondering whether this code can be paste in my post or not.

  4. Sleneau
    Member
    Posted 8 months ago #

    Well, if you want more help, we'll need some extra information about what the context your code is being used in. I would recommend starting a new thread pursuant to the Forum Welcome, and clearly lay out what your specific issue is.

    If that is all, then have a nice day.

  5. catacaustic
    very awesome
    Posted 8 months ago #

    My problem is the merchant give me a javascript code and I am wondering whether this code can be paste in my post or not.

    Not by default. There's some plugins that can allow Javscript in posts, but as a normal function it's stripped out of any post content.

    You can have it working on your page though in a few different ways. The first option is setting up a custom page template and that can hold your Javascript code. This would really only be useful if the code is system-wide and isn't going to change.

    The second, and what I'd think would be the most useful, option is to set up shortcodes for the Javascript so you can call the shortcode and it will insert your code where it needs to be. Doing it this way lets you add it inside post content without it being stripped out by the parser.

  6. Uendi
    Member
    Posted 8 months ago #

    I may consider of your suggestions and try to have it works.

    Anyway, thank you so much to both of you, Steneau and catacaustic

Reply

You must log in to post.

About this Topic