Javascript 如何保护iframe源

Javascript 如何保护iframe源,javascript,jquery,html,Javascript,Jquery,Html,我有一个web应用程序,我在其中调用了iframe中的一些asp页面链接。 我想用参数隐藏源URL。因为URL和参数数据是机密的我只想隐藏iframe源。我不使用inspect元素禁用JavaScript,因为使用firebug我们可以很容易地看到URL源代码。请帮帮我 无法帮助您使用ASP.NET,但我可以向您展示如何使用PHP,希望这能引导您走上正确的道路 <?php //contents of the file that includes the iframe $password =

我有一个web应用程序,我在其中调用了iframe中的一些asp页面链接。
我想用参数隐藏源URL。因为URL和参数数据是机密的我只想隐藏iframe源。我不使用inspect元素禁用JavaScript,因为使用firebug我们可以很容易地看到URL源代码。请帮帮我

无法帮助您使用ASP.NET,但我可以向您展示如何使用PHP,希望这能引导您走上正确的道路

<?php
//contents of the file that includes the iframe
$password = "foo";  //set your password
$key = 123456;  //this is the id that your iframe needs
$encryptedString = openssl_encrypt($key, "AES-128-ECB",$password);  //encrypt the string
?>
<!-- output the iframe and pass the token as a $_GET variabl a la str=$encryptedString -->
<iframe src="iframegenerator.php?str=<?php echo $encryptedString; ?>" />

确保使用强密码,显然不是foo。

您不能这样做。客户端必须向您的秘密URL发出HTTP请求,因此,无论以何种方式,都可以发现该URL是什么。因此,您希望隐藏HTML。你能做的最好的事情就是以某种方式混淆它,但即使如此,它也没有被隐藏或保护,只是更难阅读谢谢。。我可以加密我的URL链接吗?即使你加密了。。。。它还是会被知道的…我会自己用谷歌搜索的谢谢。。我想这样试试@潘多
//iframe code
$password = "foo";  //set your password
$encryptedString = $_GET['str'];  //get the str variable
$decryptedString = openssl_decrypt($encryptedString,"AES-128-ECB",$password); //decrypt it
echo $decryptedString;  //spit out the contents