Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Creating opensocial gadgets

Hello

I have created an opensocial gadget which should refer to the fronting app for data/services.
It works fine if I hardcode the path - but is there a way to avoid this?
I do not want to have all my widgets with paths like:
https://localhost:9444/myapp/myservice :(

0 votes



One answer

Permanent link
If your gadget is using an AjaxModule, we write the base tag into the html, so you can use:

	var baseURI = document.baseURI;

if (!baseURI) {
var baseTags = document.getElementsByTagName('base');
baseURI = (baseTags && baseTags[0].href) || document.location.href;
}

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,937

Question asked: Mar 22 '11, 8:41 a.m.

Question was seen: 6,291 times

Last updated: Mar 22 '11, 8:41 a.m.

Confirmation Cancel Confirm