variables - How can I display an alert that shows the value of a var in javascript -


i have javascript file displays popup alert has value value of var must use:

var errorsite = "web4all";  function displayerror{     alert("there has been error on " && var errorsite && "!") } 

i want have alert says:

there has been error on web4all!

just use + concatenate:

alert("there has been error on " + errorsite + "!") 

note not use var keyword here, declare new "errorsite" variable (and not use existing 1 declared)!


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -