Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Combining Perl Script and Javascript

Got a slight issue I was hoping I could get some help with. I want to change the hard coded graphics path here to use the [&GraphicsPath%] instruction. Every time I try and do this, I tangle myself up in knots. Can someone give me a nod in the right direction please so that I can quickly sort out?

Effectively I want to change:

/B2BCL/graphics/

to be

[%GraphicsPath%]

This enables me to create sub projects on one server essentially and not need to keep updating paths...

<script type="text/javascript">
  function swapImage_1(id_1,primary_1,secondary_1) {
    src=document.getElementById(id_1).src;
    if (src.match(primary_1)) {
      document.getElementById(id_1).src=secondary_1;
    } else {
      document.getElementById(id_1).src=primary_1;
    }
  }
</script><!DOCTYPE html>
<html lang="en">
<head>
<img
  id="desat_1"
  onclick="swapImage_1(
    'desat_1',
    '/B2BCL/graphics/FormalBox.jpg',
        '/B2BCL/graphics/West Centre - Tier 2 (Block 2) - Front.png'
  )"
  src="/B2BCL/graphics/FormalBox.jpg"
/>
</head>
</html>


Thanks
asked Oct 9 by crawliano (445 points)

Your solution to the original question

Please only use this to answer the original question. Otherwise please use comments.
Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

To avoid this verification in future, please log in or register.
...