I’ve used jQuery to hide a link on a webpage, but it can be easily revealed by viewing the source. I want to avoid loading the link upon page load, and then load it using AJAX or something similar by default, when the user has clicked a button to see the link.
The web page should fetch the hidden url only after user clicks the button.
Is there anyway to do this?
If I understand correctly, what you are asking is for a way to simply deliver the page without the link in the source, and then have the link be loaded through Ajax when needed.
It is important to read the jQuery documentation, to fully understand the possibilities offered by jQuery Ajax.
Update:
A full single file example, name it ‘ajax_link.php’: