5 messages in com.googlegroups.opensocial-orkut[orkut-developer] Re: external javasc...
FromSent OnAttachments
zeos19 Jun 2008 16:58 
sunnydiv22 Jun 2008 03:31 
Jason23 Jun 2008 15:50 
zeos23 Jun 2008 16:18 
zeos23 Jun 2008 16:21 
Subject:[orkut-developer] Re: external javascript file in XML file not working
From:Jason (apij@google.com)
Date:06/23/2008 03:50:14 PM
List:com.googlegroups.opensocial-orkut

External JavaScript files should work as long as you specify the absolute path, which you appear to be doing. I'm not sure why your file stopped working off-hand, but it may be due to the URL rewriting mechanism that orkut uses to automatically proxy resources like external scripts, style sheets, images, etc. You can easily disable this mechanism during development -- full details here:

http://orkutdeveloper.blogspot.com/2008/06/rewriting-returns-to-sandbox.html

Can you provide the URL to your external script? I can verify whether the original issue is related to the URL rewriting.

As far as the second issue, you need to be more specific. By "not working," do you mean the function getViewerData was not called when the application first loaded? Were you using &bpc=1 to bypass the application cache? Did you still have the external script statement in your source? A URL would help here.

On Jun 19, 4:59 pm, zeos <zenm@gmail.com> wrote:

I developed os 0.7 application with everything inside the XML file. This does gadgets.io.makeRequest to my server and was working fine. But when I removed  all javascript from the XML and put in an external file with a reference to to it in the XML file like:

<script type="text/javascript" src="http://www.mydomain.com/js/os.js" /

The app has stopped working. I did not change anything else.

Then I put back some Javascript in the xml file: <script type="text/javascript" >

                function getViewerData() {                     var req = opensocial.newDataRequest();

req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.VIEWER), 'viewer');                     'viewerFriends');                     req.send(callbackViewData);                 };

                gadgets.util.registerOnLoadHandler(getViewerData);         </script>

But it is still not working. Is this a bug in opensocial container for orcut or external javascript not supported?