You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

atomicmak

Trainee

  • "atomicmak" started this thread

Posts: 60

Occupation: E-Media Creative Work

  • Send private message

1

Monday, March 21st 2011, 11:28am

xml data information passing.

wanted to add data information for each pano through xml.

I am loading panorama through custom navigation with javascript loadpano() sort of.
would wish that event fire one more information

1 : Panorama Name :
2 : Panorama text inforamtion to be pushed in two different div's foo_title and foo_desc

can anyone explain how to add data information in xml and pull it and push it to div's ?
Regards
Mak

atomicmak

Trainee

  • "atomicmak" started this thread

Posts: 60

Occupation: E-Media Creative Work

  • Send private message

2

Tuesday, March 22nd 2011, 8:33am

anybody please guide to do this ?
Regards
Mak

3

Wednesday, March 23rd 2011, 9:00am

Hi,

sorry, I don't understand... which div's?

best regards,
Klaus

atomicmak

Trainee

  • "atomicmak" started this thread

Posts: 60

Occupation: E-Media Creative Work

  • Send private message

4

Wednesday, March 23rd 2011, 9:31am

thanks klaus for prompt reply.

Say i have one html page with four DIV in it.

on top navigation header div

then player in krpanoDIV

under that i have fContainerDIV

and inside fContainer i have two section

ftitleDIV | fdescDIV

...

i have menu in header div and on click i fire loadpano() to krpanoDIV

i want to send some more text information to update
ftitleDIV and fdescDIV from that navigation on each link i have.

hope this helps.
Regards
Mak

5

Wednesday, March 23rd 2011, 10:04am

okay, you want to send data from krpano to html/js or from html/js to krpano?

for krpano to html/js - use the js() action,
e.g.
xml:

Source code

1
... onclick="js ( jsfunction('hello from xml') );"


html/js:

Source code

1
2
3
4
function jsfunction(msg)
{
  alert(msg);
}


or for html/js to krpano - use the set/get/call interface,
html/js:

Source code

1
2
3
var krpano = document.getElementbyId("krpanoSWFObject"); // use the ID from embedding
krpano.set("anyvalue", "test123");
krpano.call("trace('hello from js anyvalue=',anyvalue);");


best regards,
Klaus

atomicmak

Trainee

  • "atomicmak" started this thread

Posts: 60

Occupation: E-Media Creative Work

  • Send private message

6

Wednesday, March 23rd 2011, 10:52am

Thanks a ton klaus. Will try an implement and report..

Thanks again
Regards
Mak

atomicmak

Trainee

  • "atomicmak" started this thread

Posts: 60

Occupation: E-Media Creative Work

  • Send private message

7

Wednesday, March 23rd 2011, 12:55pm

it worked. only thing now i have to do is find solution to pass html text.

e.g.

Source code

1
<b>Creating a paradigm shift, the hotel's many "first-of-its-kind" makes it stand apart from the rest.</B> The 55,000 square feet magnificent tropical lagoon sets the stage for magical moments. The world's 'larges


the text i am passing does not support html or special characters to pass. so i have to remove even ' from the text (e.g don't) ..


Here is javascript i call from xml

Source code

1
2
3
4
5
6
function xmlpass(p1, p2, p3)
{	
	document.getElementById("divshowcontent").innerHTML = "<span><strong>" + p1 + "</strong></span>";
	document.getElementById("comment_right").innerHTML = "<span><strong>" + p2 + "</strong><br>" + p3 + "</span>";	
	return p1;
}


here is div defined to write text from javascript to

Source code

1
2
3
<div class="commenttext_left" id="divshowcontent"></div>

<div class="commenttext_right" id="comment_right"></div>


any idea how to do ?
Regards
Mak

atomicmak

Trainee

  • "atomicmak" started this thread

Posts: 60

Occupation: E-Media Creative Work

  • Send private message

8

Thursday, March 24th 2011, 12:44pm

any help on above declaration ?
Regards
Mak

9

Friday, March 25th 2011, 11:11am

I m facing same problem,

I have called js function for text,

<krpano version="1.0.8" onstart="js( xmlpass('Public Area', 'Reception', 'testing html area','', '' )) ;" >

Is it possible to add custom html tag like bold,italic,quotation mark in above XML(bold text) it self,


Ruchit

atomicmak

Trainee

  • "atomicmak" started this thread

Posts: 60

Occupation: E-Media Creative Work

  • Send private message

10

Monday, March 28th 2011, 1:19pm

ne help update ?
Regards
Mak

Posts: 23

Occupation: Cat Sitter

  • Send private message

11

Thursday, March 31st 2011, 8:06pm

Hey Mak:

Hmm... Seeing this post from pinsane & Tuur (see the two replies above it in the thread) made me think it'd be a snap. However, that approach works fine in XML only -- as soon as I put a javascript call in, I get nothing, or undefined, a la:

Source code

1
2
3
4
5
6
7
8
//javascript:
var myText = krpano().call("get(data[myData].content);");
document.getElementById("divshowcontent").innerHTML = "<span><strong>" + myText + "</strong></span>";

<!-- XML: -->
<data name="myData">
	<p>Hello<br />World</p>
</data>


Seeing this post made me hopeful, too -- but I can't get it to work. Maybe check in with Tuur & Pinsane in those threads... And keep me posted!

Tuur? You listening? :-)

Patrick

(this post is related to conversation at this thread, re: javascript and iDevice orientation)
QTVR • AS3 • 360° Photography • Art Gallery • Storefront • Books • Generative Art • ?

Posts: 23

Occupation: Cat Sitter

  • Send private message

12

Friday, April 1st 2011, 8:17pm

Hey Mak:

I've successfully used Javascript/XML two-way communication, to get/set information from a <data/> element. This may be your answer:

passing data to javascript from xml files

HTH,

Patrick

(it's all in the syntax ;-) )
QTVR • AS3 • 360° Photography • Art Gallery • Storefront • Books • Generative Art • ?