Czy jest możliwość ukrycia zawartości pliku JavaScript (zaszyfrowania) ?
plik .js
var dane = []; info[1] = 'info 1'; info[2] = 'info 1a'; info[3] = 'info 2'; info[4] = 'info 2c'; ......... info[xxxx] = 'info xxxx';
scrypt w html
var dane = []; info[1] = 'info 1'; info[2] = 'info 1a'; info[3] = 'info 2'; info[4] = 'info 2c'; ......... info[xxxx] = 'info xxxx';
$(document).ready(function(){ $('iframe[src^="#info1"]').each(function(){ var oldUrl = $(this).attr("#info1"); // info var newUrl = oldUrl.replace("#info1"); // nowe info $(this).attr("href", newUrl); // ustaw herf value
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <script> $(document).ready(function(){ $('a[href^="http://"]').each(function(){ var oldUrl = $(this).attr("href"); // Get current url var newUrl = oldUrl.replace("http://", "https://"); // Create new url $(this).attr("href", newUrl); // Set herf value }); }); </script> </head> <body> </body> </html>