Question on user variables set method (populated from External HTML object)
July 6, 2012 12:00 AM
Hi!
I am trying to populate a couple of user variables by using javascript in an External HTML object.
In the External HTML object, I include something like:
Var_mySpecialVariable.set("Hello, world!");[/CODE]
In the title, I have used the Variable Manager to create the user variable "_mySpecialVariable".
Now my problem is, I want to use "_mySpecialVariable" to hold a web address that will be used as the Web Address in the Action on a button. (So instead of "Hello, world!", it will contain "http://www.mydomain.com/xyz".) But I can't do that as after I publish (as HTML) the title I get an error when I run the title. The setting of the variable in the External HTML object fails because the set method doesn't exist. (That in turn massively messes up the title.)
I thought the user variables' setters and getters were available as soon as the variables were created.
However, if I create a text block on a page in the title and change the contents of the text block to the contents of the user variable "_mySpecialVariable", then everything seems to work okay and the set method is available. But I really don't want to display the contents of the user variable (even if I hide it so it isn't actually seen).
Can someone explain (or point me to) something that tells me when or under what conditions the set method for a user variable is actually created in the title? And is there another way of having it created without using it to change the contents of a text block?
Dan
(Sorry if this is a noob question.)[CODE]Var_mySpecialVariable.set("Hello, world!");[/CODE]
In the title, I have used the Variable Manager to create the user variable "_mySpecialVariable".
Now my problem is, I want to use "_mySpecialVariable" to hold a web address that will be used as the Web Address in the Action on a button. (So instead of "Hello, world!", it will contain "http://www.mydomain.com/xyz".) But I can't do that as after I publish (as HTML) the title I get an error when I run the title. The setting of the variable in the External HTML object fails because the set method doesn't exist. (That in turn massively messes up the title.)
I thought the user variables' setters and getters were available as soon as the variables were created.
However, if I create a text block on a page in the title and change the contents of the text block to the contents of the user variable "_mySpecialVariable", then everything seems to work okay and the set method is available. But I really don't want to display the contents of the user variable (even if I hide it so it isn't actually seen).
Can someone explain (or point me to) something that tells me when or under what conditions the set method for a user variable is actually created in the title? And is there another way of having it created without using it to change the contents of a text block?
Dan
(Sorry if this is a noob question.)
Discussions have been disabled for this post