You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Marc-André GROSY <Ma...@cidj.com> on 2005/10/18 16:37:46 UTC

Javascript & lenya

Hi, I want execute this action: '?lenya.step=showscreen&amp;lenya.event=addAsset&amp;lenya.event=addAsset&amp;lenya.usecase=asset' with an javascript. But if I eval this like : eval('?lenya.step=showscreen&amp;lenya.event=addAsset&amp;lenya.event=addAsset&amp;lenya.usecase=asset'), it's doesn't work. 

How could I launch a usecase with javascript ?

Thanks for your response

Marc

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Javascript & lenya

Posted by so...@gmail.com.
On 10/18/05, Marc-André GROSY <Ma...@cidj.com> wrote:
> Hi, I want execute this action: '?lenya.step=showscreen&amp;lenya.event=addAsset&amp;lenya.event=addAsset&amp;lenya.usecase=asset' with an javascript. But if I eval this like : eval('?lenya.step=showscreen&amp;lenya.event=addAsset&amp;lenya.event=addAsset&amp;lenya.usecase=asset'), it's doesn't work.

Go read a JS Tutorial.  Chapter 1 should have something like:
window.location = "myNewURL";

Chapter 15 will have something like:
eval("print(" + myDynamicVariableName + ");");

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Javascript & lenya

Posted by so...@gmail.com.
On 10/18/05, Martin Heiden <ma...@netcologne.de> wrote:
> window.location.href = '?lenya.step=showscreen&lenya.event=addAsset&lenya.event=addAsset&lenya.usecase=asset';

That would also work, but only because when Netscape created
JavaScript, they correctly assumed most developers would not read the
manual, and each function tries to make sense of garbage input.  Every
browser (except MSIE in some place, but this is not one of them) made
certain to handle everything the same as Netscape.

The "location" object is a string with extra features, and when
associated with a window or frame, any change also changes what is
displayed.  The "href" attribute is redundant, because using the
object directly always produces the same results.  The whole object is
returned by either "location" or "location.href".  Setting either the
"location" object or the "location.href" tries to figure out what was
meant.  In this case, we are setting "location.search".  Because
JavaScript is so forgiving, all of these are equivalent:

window.location = "?myQuerystring";
window.location.href = "?myQuerystring";
window.location.search = "?myQuerystring";
window.location.search = "myQuerystring";

The first two see the question mark, and decide you really meant to
change "location.search".  The last two change "search" directly, and
JS is smart enough to ignore the redundant question mark in the third.
 The last one is the best use of the object model, but the first is
the shortest to type and the easiest to use.

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Javascript & lenya

Posted by Martin Heiden <ma...@netcologne.de>.
Marc-André,

Tuesday, October 18, 2005, 4:37:46 PM, you wrote:

MAG> Hi, I want execute this action:
MAG> '?lenya.step=showscreen&amp;lenya.event=addAsset&amp;lenya.event=addAsset&amp;lenya.usecase=asset'
MAG> with an javascript. But if I eval this like :
MAG> eval('?lenya.step=showscreen&amp;lenya.event=addAsset&amp;lenya.event=addAsset&amp;lenya.usecase=asset'),
MAG> it's doesn't work. 

Shouldn't it be something like:

window.location.href = '?lenya.step=showscreen&lenya.event=addAsset&lenya.event=addAsset&lenya.usecase=asset';

Martin


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org