How to call .NET web service inside Javascript within XSLT
I've got some XSLT that contains Javascript. I need to pass one of the Javascript variables to a webservice. I've seen messages say, oh yeah, it can be done, but no code examples.
<xsl:if test="$currentPage/ancestor-or-self::* [activeMenu = 'Lawyers' or @id=1672]"> <script type="text/javascript" src="/js/jquery.ba-postmessage.min.js"></script> <script type="text/javascript"> $(function(){ // Pass the parent page URL into the Iframe in a meaningful way (this URL could be // passed via query string or hard coded into the child page, it depends on your needs). var src = 'http://<xsl:value-of select="umbraco.library:Replace(umbraco.library:RequestServerVariables('SERVER_NAME'),'.azbar.','.myazbar.')" />/includes/logInOut_btn_iFramed.cfm#' + encodeURIComponent(document.location.href), // Append the Iframe into the DOM. iframe = $('<iframe src="' + src + '" name="logInOut_btn_iframe" id="logInOut_btn_iframe" width="200" height="32" frameborder="0" allowtransparency="yes" marginheight="0" marginwidth="0" scrolling="no" class="btn-login-iFrame"></iframe>') .appendTo('#theIFrame'); // Setup a callback to handle the dispatched MessageEvent event. In cases where // window.postMessage is supported, the passed event will have .data, .origin and // .source properties. Otherwise, this will only have the .data property. $.receiveMessage(function(e){ alert("XSLT: " + e.data); if (e.data=="loggedIn=yes") { isLoggedIn = "Yes"; } else if (e.data == "loggedIn=no") { isLoggedIn = "No"; } // ***** SEND isLoggedIn VALUE TO WEB SERVICE //SBA.AZBar.UserControls.SetLoggedInStatus.setStatus(isLoggedIn); // An optional origin URL (Ignored where window.postMessage is unsupported). }, 'http://<xsl:value-of select="umbraco.library:Replace(umbraco.library:RequestServerVariables('SERVER_NAME'),'.azbar.','.myazbar.')" />' ); }); </script> </xsl:if> <span id="theIFrame"></span>
How to call .NET web service inside Javascript within XSLT
I've got some XSLT that contains Javascript. I need to pass one of the Javascript variables to a webservice. I've seen messages say, oh yeah, it can be done, but no code examples.
How can I call a webservice AND pass it a value?
Here is my XSLT, where you can see where I need to pass the value.
is working on a reply...