Javascript in XSL if statement

Posted on 2011-10-25
Last Modified: 2012-05-12
I have 2 simple lines of code below.  Im having difficulty comparing the string "main" to the variable selectedTab which also contains a string "main"... I've debugged it and had an alert(selectedTab); after the first line...

In other words, the logic is correct but on line 2 my syntax is NOT correct... please help.

Whats the syntax for me to be able to test in xsl if "main" = selectedTab variable ?

<script>var selectedTab = findSelectedTab();</script>
<xsl:if test=" 'main' = selectedTab">

Open in new window

Question by:Squadless
    1 Comment
    LVL 81

    Accepted Solution


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
    Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
    In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now