我创建了一个带有xss.js的index.html,它调用了jQuery.get()函数.然后我在浏览器(Firefox,Chrome,IE和Opera)中打开了index.html并试图触发ajax请求.
这是我的index.html:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>XSS</title>
<script src="libs/js/jquery-1.7.2.js" ></script>
</head>
<body>
<button id="request" >fire</button>
<script src="libs/js/xss.js" ></script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
和我的xss.js:
function init()
{
$('#request').click(loadContent);
}
function loadContent()
{
$.get('http://www.example.com/', null, function(data){
alert('success');
$('body').html(data);
}, 'html');
}
init();
Run Code Online (Sandbox Code Playgroud)
如果我index.html在浏览器中打开(file:///C:/workspace/xss%20test/index.html),单击按钮后会收到以下响应:
Firefox:没有错误代码(HTTP/1.1 200 OK),但答案是空的
IE:没有答案
Chrome:
XMLHttpRequest cannot load http://www.example.com/. Origin null is not allowed by Access-Control-Allow-Origin.
Opera:没有错误代码(HTTP/1.1 200 OK)和完整的html文件作为答案,但不显示任何内容(未触发成功回调)
此代码将加载index.html到我的Android …
我有两个不同的应用程序,我想像这样在同一个 Azure WebApp 上部署它们:
webapp.azurewebsites.net/api/ <-- run the Java REST API here
webapp.azurewebsites.net/site/ <- put the Angular2 app here
Run Code Online (Sandbox Code Playgroud)
这两个应用程序都部署在服务器上,但目前我只能让 REST APIweb.config像这样运行:
webapp.azurewebsites.net/api/ <-- run the Java REST API here
webapp.azurewebsites.net/site/ <- put the Angular2 app here
Run Code Online (Sandbox Code Playgroud)
但我无法访问服务器上的 Angular2 应用程序,并且找不到有关如何同时配置 Java 应用程序和 Angular2 应用程序的文档。
我还尝试使用Virtual applications and directoriesAzure 仪表板下的设置来实现此目的Application settings- 但它不起作用,我找不到有关如何实现此目标的体面文档,或者是否可以通过设置Virtual applications and directories.
我试图移动 Angular2 站点,但无法配置服务器,以便在 Java 应用程序运行时可以访问 Angular2 应用程序。
有人可以向我指出有关如何实现这一点的良好文档,或详细描述部署过程(关于配置,例如Application settings来自 Azure 仪表板和web.config文件)?
我有一个number输入字段,我想用Angular2验证:
<input type="number" class="form-control" name="foo" id="foo"
[min]="0" [max]="42" [(ngModel)]="foo" formControlName="foo">
Run Code Online (Sandbox Code Playgroud)
到目前为止,这在Chrome中运行良好,因为Chrome会忽略字符作为输入(不会将它们插入输入 - >输入为空 - >必需的验证触发器,或者已经有一个数字,因此最小/最大验证触发器).
另一方面,Firefox让用户输入字符到输入中,这就是问题,如果我插入字符,那么所需的验证触发器和表单控件的值将评估null结果如下:
我想区分空值和无效模式,但我发现实现这一点的唯一方法是input type="text"使用模式验证器,因为输入的值是null(如果它包含字符)并且模式验证器不会触发这个input type="number".
有没有办法使用Angular2 FormGroup对象访问该字段的实际值(甚至document.querySelector('#foo').value评估为null虽然输入包含42bar)?
或者有没有办法检查输入字段是否包含字符?
或者除了使用之外别无他法input type="text"吗?
我有一个天蓝色的SQL数据库,并希望使用数据库中的数据进行Azure流分析 - 我知道我必须使用Blob存储才能将我的数据用作流分析作业的参考数据.
现在,将我的SQL数据导入流分析作业以丰富我的传入数据的最佳方法是什么?
azure azure-storage-blobs azure-stream-analytics azure-sql-database
azure ×2
javascript ×2
ajax ×1
android ×1
angular ×1
cross-domain ×1
mobile ×1
typescript ×1
validation ×1
web-config ×1