XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Posttop
Ryan ChanSubject: Need Help on XSL with Javascript... Please help...
Author: Ryan Chan
Date: 14 Dec 2006 12:25 PM
Thank you for viewing this post.

I'm new on XSL, recently have a project.
In my project, I have a link which need to generate it's href URL dynamically. Thus, I used javascript to populate the URL.

==============================
===== below are the code =====
==============================

<script src="_blog/function.js" type="text/javascript" />

<a href="javascript:aLink('{$header}')" title="a">
<img src="_blog/a.gif" />
</a> |
<a href="javascript:bLink('{$header}')" title="b">
<img src="_blog/b.gif" />
</a> |

=============================================
===== below are some code in function.js =====
=============================================

function aLink(title)
{
var link = "http://www.aa.com/post?url=" + extractLoc(location);
//window.location = link;
return link;
};

function bLink(title)
{
var link = "http://www.bb.com/submit?url=" + extractLoc(location);
//window.location = link;
return link;
};

Above is my code...
At first, I used the //window.location = link; // to perform the navigation. But if using // javascript:aLink('{$header}') // when the cursor hover the link the status bar will show // javascript:aLink('aa') // instead of the url.

I need to show the entire URL on the status bar.

At first I though is easy, just like normal calling a function and get the return value and populate the link. But it doesn't work.

Anyone willing to give me some hints or help.
Thank you in advance.

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.