PaulPeterson1
5 years agoQrew Assistant Captain
Use a Variable in a javascript Alert box
I am trying to create an alert box that returns the value of a variable. I tried using this:
var text Danger = "<a style=\" text-decoration: none; background: #FF0000; border-radius: 5px; color: #fff; display: inline-block; width: 220px; text-align: center; padding: 8px 20px; font: normal 700 14px/1 \"Calibri\", sans-serif; text-shadow: none; \" href=\"javascript:alert(" & $message & ")\">MS Readiness</a>";
Rather than getting a button that will trigger an alert box I an getting a button that does nothing and the button text is the value of the variable plus ")\>MS Readiness.
I'm guessing this is a simple syntax error, but I'm not seeing the error.
------------------------------
Paul Peterson
------------------------------
var text Danger = "<a style=\" text-decoration: none; background: #FF0000; border-radius: 5px; color: #fff; display: inline-block; width: 220px; text-align: center; padding: 8px 20px; font: normal 700 14px/1 \"Calibri\", sans-serif; text-shadow: none; \" href=\"javascript:alert(" & $message & ")\">MS Readiness</a>";
Rather than getting a button that will trigger an alert box I an getting a button that does nothing and the button text is the value of the variable plus ")\>MS Readiness.
I'm guessing this is a simple syntax error, but I'm not seeing the error.
------------------------------
Paul Peterson
------------------------------