jquery hide load url
how to hide load url in jquery?i 开发者_Go百科want to hide pmscount.php
{
$('#notification').load('pmscount.php').fadeIn("slow");
}, 10000);
You can't.
Because the script is sent to the client, they will always be able to read it.
You could try obfuscation or encryption methods, but ultimately it will be sent to the client. You might want to try different methods of security such as checking your inputs.
If you want a quick and dirty check to make sure only AJAX is requesting the page, you can check if the HTTP_X_REQUESTED_WITH
is set to XMLHTTPRequest
, as most popular AJAX clients such as jQuery send this header when they make an AJAX request, but this is spoofable.
You can't hide it, but you can obfuscate it, which can make it hard to read.
However, obfuscation is not really hidden or secure, so you shouldn't use it for real security purposes.
If you are just interested in making it hard (but still possible) to read, you can use something like this obfuscation tool to make the url hard to read.
This is difficult to read, but is still trivial to decode (someone can just evaluate it using any javascript environment).
If you really need it to be secure, you should make the request on the server side, not via javascript.
精彩评论