Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

  • »nathanfjohnson« ist der Autor dieses Themas

Beiträge: 11

Wohnort: Calgary Canada

Beruf: Student

  • Nachricht senden

1

Mittwoch, 8. Juli 2009, 07:48

Functions with Javascript - Please help

I made a function so that the caller can call the function and send it to a givin xml file
I'm new to javascript but it looks like it will only let me call the function with numbers, not strings. Ca

The function
:
function goto(xml, toh, tov, fov)
{krpano().call( "loadpano("+xml+",null,MERGE,BLEND(1));lookat(" + toh +"," + tov + "," + fov + ")" );}

The Caller:
<a onclick="goto(home.xml,-95,0,80)">go home</a>

I would really like to figure it out, everything works great until I call the function with the xml file's name, it lets me call it with a number.
Is it something to do with the "+ +"? I'm not sure what those are but it seems to need them.

Thanks

2

Mittwoch, 8. Juli 2009, 15:41

Hi,

I think you need to put the "home.xml" in quotes (single quotes or double quotes, depending on the outer ones), otherwise javascript will look for a "home" object with the attribute "xml"
e.g.

Zitat

<a onclick="goto('home.xml',-95,0,80)">go home</a>
best regards,
Klaus

  • »nathanfjohnson« ist der Autor dieses Themas

Beiträge: 11

Wohnort: Calgary Canada

Beruf: Student

  • Nachricht senden

3

Donnerstag, 9. Juli 2009, 06:47

Thank you

Thanks, it works great