Sie sind nicht angemeldet.

Scott Witte

Fortgeschrittener

  • »Scott Witte« ist der Autor dieses Themas

Beiträge: 382

Wohnort: Milwaukee, WI USA

Beruf: Professional Photographer

  • Nachricht senden

1

Freitag, 22. Juli 2016, 00:05

How do you send URL with Placeholder to javascript, html etc.

How do you send a url with a placeholder like %SWFPATH% to something external like javascript? Is there a way to decode the placeholder to create a more understandable url string?

Scott Witte

Fortgeschrittener

  • »Scott Witte« ist der Autor dieses Themas

Beiträge: 382

Wohnort: Milwaukee, WI USA

Beruf: Professional Photographer

  • Nachricht senden

2

Freitag, 22. Juli 2016, 01:38

So... It appears this can be done externally by calling the parsePath function on the krpano object, but is there a way to access that directly within krpano?

Otherwise this works:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
<action name="some_name">
	parse_path(%SWFPATH%);

	trace("Parsed path = ",get(parsed_path));
</action>

<action name="parse_path" type="Javascript">
	<![CDATA[
	var	url = krpano.parsePath( args[1] );
	krpano.set("parsed_path", url);
	]]>
</action>

And if you are passing a url to some external javascript you can just use the parsePath there. Hmmm maybe I've answered my own question?

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Scott Witte« (22. Juli 2016, 03:03)