Jump to content

"Persist" scene-host JavaScript prototype objects during page life time


Recommended Posts


I've got a peculiar thing. I want to capture the instances in such a way that once I've left my create scene handlers, I can return to my model calculators (i.e. scene hosts).

User will engage with some form fields, during which time, I want to look up the related model calculators and make changes, potentially rebuild the scene based on the input.

I've tried something like this, but it falls over on account of the scene object, deep within which is circular I think; somewhere is, at any rate. Point is, jumping to/from JSON is not going to work very well for purposes of what I am doing.

<script type="application/json" id="data">
    {"calc1": null, "calc2": null, "calc3": null}

Perhaps I will need to completely decouple the calculator configuration from the scene modeling bits, that's probably the right longer range answer. But I want to see if I can make it work without jumping to/from JSON first.

Partly, too, is my ignorance concerning JavaScript object life cycle of variables throughout the scripts, i.e. if they survive the load and can be referenced at a later point.


Michael Powell

Link to comment
Share on other sites

@JCPalmer Well, it's not a mesh, per se, but it does accept some parameters and performs some calculations; i.e. model/calculator is the name for the pattern. I do call a build function that I use to generate my meshes, however.

Focusing my question a bit, can I jQuery for mesh items, like by their names? If I can do that, then I could potentially completely decouple calculators, and store the calculation config as JSON, then interface with the scenery meshes later during the page life time.

Thank you...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...