[Xerte] Calling a function

xerte at lists.nottingham.ac.uk xerte at lists.nottingham.ac.uk
Tue Aug 28 09:15:22 BST 2007


It works for me. There are errors in your code:

You have a nested string, which you are surrounding with single quotes '
when the entire string is surrounded with single quotes.

getURL('javascript:test("param");', ''); //this works and calls the
function 'test' defined in rloObject.js. Note the quotes.

Also, getURL takes two parameters, the second needs to be an empty
string. 

Julian

-----Original Message-----
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of
xerte at lists.nottingham.ac.uk
Sent: 25 August 2007 20:56
To: xerte at lists.nottingham.ac.uk
Subject: RE: [Xerte] Calling a function

I'm having trouble with the recent code.  I publish my piece and insert
the following at the bottom of rloObject.js:

function myFunction(arg){
  alert('I am a function and my argument is ' + arg); }

The piece contains a button that, when clicked, runs this code:

getURL('javascript:myFunction('a test');');

I run the piece and click the button.  The result: a new IE window opens
for about 1/2 second and then a message box appears:  Internet Explorer
cannot download.  Unspecified error.

I've tried several variations of the code but still get the same
message.

I can place a simple function in the html page and call it from the same
page with this code:

<html>
<head>

<script type="text/javascript">
function myfunction()
{
alert("HELLO")
}
</script>

</head>
<body>

<form>
<input type="button"
onclick="myfunction()"
value="Call function">
</form>

<p>By pressing the button, a function will be called. The function will
alert a message.</p>

</body>
</html>

But I'm unable to call a function in rloObject.js.  What am I missing?

Thanks.

Jim

-----Original Message-----
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk]On Behalf Of
xerte at lists.nottingham.ac.uk
Sent: Wednesday, August 22, 2007 3:14 AM
To: xerte at lists.nottingham.ac.uk
Subject: RE: [Xerte] Calling a function


You need to modify rloObject.js and add your functions to the bottom of
it like this:

function myFunction(arg){
  alert('I am a function and my argument is ' + arg); }

Then you can call the function from Xerte using getURL:

getURL('javascript:myFunction('a test');');

Julian

-----Original Message-----
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of
xerte at lists.nottingham.ac.uk
Sent: 21 August 2007 22:37
To: xerte at lists.nottingham.ac.uk
Subject: [Xerte] Calling a function

I am trying to minimize the active window from a button.  Although
javascript will not minimize the window, there is a workaround.  The
following code moves the current window off screen.

<script language="javascript">
show=1
function minimize(){
  moveBy(2000,2000)
  show=0
}
function reshow(){
  if(show==0){
    moveBy(-2000,-2000)
    show=1
  }
}
</script>

I plan to add the code onfocus=reshow() to the body tag.  When the focus
is passed back to the window, the code in the body tag will return the
screen to it's original location.

I also need to add code so the button calls the function:  minimize().
I need help here.  How can I call this function in Xerte?

Jim

James Bowman Associates
Customized Quality Management Services

701 Canterbury Drive
Appleton, WI 54915
Phone:  800-731-7488
Fax:  920-731-7193
james at jbassoc.biz
www.jbassoc.biz

_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte
_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte

_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte


More information about the Xerte mailing list