gpt4 book ai didi

java - 如何在javascript中的控制台中打印多行?

转载 作者:太空宇宙 更新时间:2023-11-04 12:00:33 24 4
gpt4 key购买 nike

我试图在控制台中打印多行(如下所示),但我无法打印它。

<!DOCTYPE html>
<html lang="en-US">
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<body>

<div ng-app="">

<p>Name : <input type="text" ng-model="name"></p>
<h1>Hello '{{name}}'</h1>enter code here

</div>
</body>
</html>

最佳答案

我解决了

public class MultipleStringPrint {
public static void main(String[] args) {

String str = "<!DOCTYPE html> \n <html lang=\"en-US\"> \n "
+ "\"<script src=\"http:\\/\\/ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js\"><\\/script> \n "
+ "<body> \n <div ng-app=\"\">\n "
+ "<p>Name : <input type=\"text\" ng-model=\"name\"></p>\n \t "
+ "<h1>Hello '{{name}}'</h1>\n "
+ "\t <\\/div>\n "
+ "<\\/body>\n "
+ "<\\/html>\n";

System.out.println(str);
}
|

关于java - 如何在javascript中的控制台中打印多行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40955708/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com