How to execute the web scrpt from HTML File

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2009 10:02 PM
I created web script (JS, Description and Reponse template) in alfresco. If i specify the URL of the webscript in the browser (http://localhost:8080/alfresco/service/events/get), i am getting the proper response.
My question is how we can execute the web script from static html page and inject the response back in to the same static HTML (DOM) . Because my static html has different secitons. The response of the webscript is only a part of my HTML page.
Please help me out in resolving this issue. Its very urgent.
Thanks
Chandra
My question is how we can execute the web script from static html page and inject the response back in to the same static HTML (DOM) . Because my static html has different secitons. The response of the webscript is only a part of my HTML page.
Please help me out in resolving this issue. Its very urgent.
Thanks
Chandra
Labels:
- Labels:
-
Archive
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2009 08:11 AM
Make an ajax request. Here's part of what you should do (using the YUI ajax library):
<script type="text/javascript"> window.onload = function() { var url = 'http://localhost:8080/alfresco/service/events/get'; YAHOO.util.Connect.asyncRequest('GET', url,{ success: function(o) { document.getElementById('eventlist').innerHTML=o.responseText; } }); }</script>

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2009 11:28 AM
Thanks a lot. Its working fine.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2009 12:21 PM
I am facing new issue here. Every thing is working fine in my website. But from alfresco when i click on preview website, i am getting the permission denied script error. ( that is on making ajax request to execute webscript).
Please help me out in resolving this issue.
Thanks
Chandra
Please help me out in resolving this issue.
Thanks
Chandra

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2009 03:35 PM
In this case i am getting the following script error.
Security Error: Content at http://admin.recoverywebsite.www--sandbox.127-0-0-1.ip.alfrescodemo.net:8180/ may not load data from http://localhost:8080/alfresco/service/events/get.
How to resolve this issue.
Thanks
Chandra
Security Error: Content at http://admin.recoverywebsite.www--sandbox.127-0-0-1.ip.alfrescodemo.net:8180/ may not load data from http://localhost:8080/alfresco/service/events/get.
How to resolve this issue.
Thanks
Chandra

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2009 03:02 PM
ajax can't make calls to a different domain. localhost != recoverywebsite
You're going to have to change how your virt server is named.
You're going to have to change how your virt server is named.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2009 12:56 AM
I have come across the same problem and have got around it using window.name transport.
Instead of using YUI I have used dojo to implement the execution of my web script.
Not sure if this is the best approach but it worked for me and I achieved results.
Below is the link to the tutorial I followed.
http://www.sitepen.com/blog/2008/07/22/windowname-transport/
and here's another one that may come in handy
http://www.sitepen.com/blog/2008/07/31/cross-site-xhr-plugin-registry/
Instead of using YUI I have used dojo to implement the execution of my web script.
Not sure if this is the best approach but it worked for me and I achieved results.
Below is the link to the tutorial I followed.
http://www.sitepen.com/blog/2008/07/22/windowname-transport/
and here's another one that may come in handy
http://www.sitepen.com/blog/2008/07/31/cross-site-xhr-plugin-registry/
