Jump to content

lordzardeck

Members
  • Posts

    82
  • Joined

  • Last visited

    Never

Everything posted by lordzardeck

  1. Oh, okay. Thanks. I solved the problem though. I needed to call serialize on the object BEFORE placing it in the session variable, and then call unserialize when retrieving it.
  2. My object is loaded into a session variable at the end of the script. The next time the script is ran, the object is loaded from the session variable. When it does, I get this error: Fatal error: attackSystem::startAttack() [<a href='attacksystem.startattack'>attacksystem.startattack</a>]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "trainingDummy" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /home/bfwd/public_html/lordsarmy/handlers/attacksystem.php on line 46 What does this mean?
  3. Ok, i figured it out. I took the json encoded text within php and did a regex search for "fn": and removed the quotes around the text eclosed to the right of "fn":. When the json was loaded and parsed, it loaded it as a function. Thanks anyways!
  4. I was unable to use eval because the the json keys and values are surrounded by " ". My navigation is created in by the yui library. The format it needs to be in is this: [ {"text":"Home"}, {"text":"Catalog","submenu": {"id":"catalogSub","itemdata": [ {"text":"Catalog", onclick: {fn: somefunction}}, {"text":"Add Book", onclick: {fn: function(){dosomething();}}} ] } }, {"text":"Patrons"} ] I can create a javascript file that i can dynamically load and execute, but that would involve having to iterate throught the entire array, and involve a lot of extra work. If it comes to that I guess I'd have to, but I would really like a better way. Is there someway to convert a string to a function?
  5. How would you return a javascript function withing JSON encoded in php. I want to build a js menu with an onclick feature built by php dynamically, and encoded in JSON. is this possible? If not, does anyone have a better suggestion?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.