• Is it a good idea to paste an inline code in new Page (files weight ~20KB-80KB) ?
    I’m making a SVG interactive map that uses both CSS and JS. The problem is that JS doesn’t work with files, only inline code. It all works just I’m wondering if this much lines of SVG code will put a strain on my DB.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Personally, I prefer separation of XML (of which SVG is a subset) and HTML, so I prefer SVG in separate files. Did you know that SVG code itself can contain JS and CSS? So you could create your interactive map completely inside the SVG file (I’m assuming, without knowing any specifics about your project) and then put it wherever you want. That way you could even use it independently, i. e. as a single file.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Keep it in a separate file and then use code in the page template to read it and print it inline so that the JS will work.

    Thread Starter serpher

    (@serpher)

    @otto42
    I’m kinda confused by your answer. I have to put or <object> code in page template pointing to that svg file?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘SVG inline code in Pages – Good or Bad idea?’ is closed to new replies.