Mil*_*Inc 0 javascript liferay-6
我正在应用javascript,但它会触发错误:
**missing ; before statement**
String str = document.location.href;
alert(str);
str.replace( "/blogs/-/blogs", "blogs" );
Run Code Online (Sandbox Code Playgroud)
您的任何建议表示赞赏.
更改
String str = document.location.href;
Run Code Online (Sandbox Code Playgroud)
至
var str = document.location.href;
Run Code Online (Sandbox Code Playgroud)
您不要使用JavaScript中的类型声明变量,而是使用var
关键字.