How to hide iframe url From HTML source code?
<iframe src="http://mysite.com" frameborder="0" scrolling="no" width="728" height="90"></iframe>
How to hide iframe url From HTML source code?
<iframe src="http://mysite.com" frameborder="0" scrolling="no" width="728" height="90"></iframe>
There's no way to fully block source viewing. But there are a couple ways to disable right-clicking:
1) Javascript:
2) Add the following into your tag: oncontextmenu="return false"
reference
https://forum.powweb.com/archive/index.php/t-36161.html
You can use javascript to load the source, and it will not be visible in
iframe url
in page source code. For example withjQuery
:Example here.
You can combine it with
$.post
to get the value serverside:You can even load
iframe
itself to some element like:etc. solutions are many, this is just one of.
You can't. If the URL isn't in the HTML, how would the browser know where to get it?
One thing you could try is to obscure it to make it slightly harder for someone to find it. You could have the
src
attribute be blank and then when the document is ready fetch the URL value from the server in a separate AJAX request and update theiframe
tag to include that value in thesrc
.This would be a fair amount of work, however, and wouldn't really accomplish anything. The only thing it would prevent is somebody finding it by viewing the page source. They can still look at the "current version" of the HTML in any web browser's debugging tools. (Right click on an element and inspect it, which is nearly ubiquitous at this point.) Or any other normal traffic-sniffing tools will see it plain as day.
Ultimately, if the web browser needs to know a piece of information, then that information needs to be visible on the client-side.