Calling Web Script from WCM

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2009 06:19 AM
Hi,
i have created a web script and i would like to know how to call this web script from the website that i have created with the WCM and integrate the web script´s response (wich is HTML) in this web site.
Thank you and regards.
i have created a web script and i would like to know how to call this web script from the website that i have created with the WCM and integrate the web script´s response (wich is HTML) in this web site.
Thank you and regards.
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2009 09:47 AM
Tipically using an Ajax call to get all the HTML content generated by your custom webscript, in this way (local GET WebScript example):
<script type="text/javascript"> window.onload = function() { var webscriptUrl = 'http://localhost:8080/alfresco/service/yourCustomWebScriptUrl'; YAHOO.util.Connect.asyncRequest('GET', webscriptUrl,{ success: function(o) { document.getElementById('yourCustomIdElementOnThisHtmlPage').innerHTML=o.responseText; } }); }</script>
This script required that you have to build your HTML with a yourCustomIdElementOnThisHtmlPage as a DIV element:<div id="yourCustomIdElementOnThisHtmlPage">…YOUR CUSTOM WEBSCRIPT OUTPUT WILL BE HERE…</div>
Hope this helps.
