PDA

View Full Version : Embeding VBscript in JavaScript


demetries
04-22-2004, 09:46 AM
I have this Java script that adds to favorites and is executed from a link.

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function addbookmark()
{
bookmarkurl="http://www.millionairelottery.net"
bookmarktitle="Welcome To Millionaire Global Internet Lottery"
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
// End -->
</script>

I need to emded Vbscript within this JavaScript. I have tried placing all my Vbscript
syntax within the <% %> but it erros.

Please can someone let me know how its done?

Thanks

glenngv
04-22-2004, 11:25 AM
Can you show the VBScript code that you want to embed inside javascript?

miranda
04-25-2004, 06:19 AM
<SCRIPT type="text/javascript">
<!--
var x = //define the variable;
// -->
</script>
<SCRIPT type="text/vbscript">
<!--
dim x
x = 'define the variable
// -->
</script>
<SCRIPT type="text/javascript">
<!--
if (x){
//do what you want to do ;
}
// -->
</script>


Like That? or did you mean

<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
<!--
function addbookmark()
{
bookmarkurl="<%=someURL%>"
bookmarktitle="<%=someTitle%>"
if (document.all){
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
}
// -->
</script>