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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -