S
S
s3ek2010-10-14 20:46:15
JavaScript
s3ek, 2010-10-14 20:46:15

Vkontakte open api and rights issue?

I can not figure out how to set the rights to the application. Everything seems to be simple:
We connect in the header

&lt;script src=&quot;http://vk.antizapret.ru/js/api/xd_connection.js?2&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;<br/>
&lt;script src=&quot;http://vkontakte.ru/js/api/openapi.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;<br/>

Next, write in body
&lt;script type=&quot;text/javascript&quot;&gt;<br/>
<br/>
VK.init({<br/>
 apiId: my_id<br/>
 });<br/>
<br/>
VK.UI.button('login_button');<br/>
<br/>
VK.callMethod('showInstallBox',0);<br/>
&lt;/script&gt;<br/>
<br/>

Authorization is normal, all api through VK.api are working fine, but as soon as I want to call showInstallBox an error appears
TypeError: Result of expression 'options' [undefined] is not an object. vkontakte.ru/js/api/openapi.js:317

I also tried to call on onClick, after the page is fully loaded, the same thing.
What am I doing wrong? Maybe something is not connected? Maybe I'm calling it wrong?
Thank you in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lafayette, 2010-10-29
@lafayette

Similar problem.
I figured out what is happening because of the conflict between xd_connection and openapi.
If xd_connection is loaded first, then the openapi functions (widgets, etc.) do not work, if vice versa, then the js api functionality of the contact does not work accordingly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question