Passing two parameters to Javascript function -
Actually there is really silly question, but I can not get it to work:
Function ShowOn (guardian, childish) {alert (guardian); Childid; } & Lt; A href = "#" onClick = showOne ('div1', 'div2') & gt; 91 & lt; / A & gt; Actually I want to pass two parameters on the function, but I have found: "Unwanted syntax error: unexpected token" to verify JavaScript Is there a smart site for? I.e. leaving the desired error in reporting Chrome to error.
/ Patrik
You need a quote around the attribute value:
& lt; A href = "#" onClick = "showOne ('div1', 'div2')" & gt; 91 & lt; / A & gt; & Lt ;! - here ----- ^ and here ----------- ^ - & gt; In HTML, an attribute value can not contain quotes only if it does not have space (or some other letter) since there is a place in the value you want to set , You have to put it in quotes.
Is there a smart site to verify JavaScript? That means leaving a little bit to be desired to do error reporting in Chrome.
You are looking for a "lint" device perhaps the most famous Lint Tool for JavaScript is Crockford, but it is affected by its individual style and views heavily Therefore called an active fork which is very popular both are online and command line versions. Some IDE lint options also provide options, such as JetBrains.
Comments
Post a Comment