Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Javascript question

Name: Anonymous 2011-08-19 14:28

How do you add some content in a specific place in Javascript at the user's bequest? I'm writing a sort of CSS designer with the idea that it shows the user what the style looks like by writing it to a file and then loading it (using PHP). The thing is I want it to actually be useful, so it needs to be able to have as many elements and properties as the user wants. I know that trick where you have an empty <div> and set its innerHTML member but that will leave me a set number, and I don't want to just stick billions and billions of <div> tags inside my code (its already messy enough).

tl; dr how do I dynamically instert code into a webpage at a set position but allowing an arbitrary number of insertions?

Name: Anonymous 2011-08-19 15:57

I don't really understand your answer.

I have an interface that looks like this:

|   Comment   |
| CSS Section |
{
    |   Property   | : |    Value    | ;
    Add property
}
Add section

The boxed-in things are text entries and the underlined things are URLs (which are just <a href="#" onClick="someFunction()">)

When the user clicks "Add property" I want it to insert "|   Property   | : |    Value    | ;". I can do that fine by putting a <div> there and changing it's innerHTML member, but that means limiting the number of properties that the user can have and I want it to be limited by the hardware, OS or browser, but not by my HTML code.

The same goes for "Add section".

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List