I would like to keep a part of a script server sided so we can do the update for clients ourselves here. But reading on the internet did not make clear what would be the best way. Simply put the script looks like this:
$(function () {
var id_user = XXXX; // this is what the client needs to connect
// Obfuscated Code, this section i would like to load from the server
var _$_2cfd=["\x3C\x64\x69\x76\x20\x69\x64\x3D\x22\x43\x65\x6C\x65\x62\x72\x69\x74\x79\x43\x6F\x6E\x74\x61\x69\x6E\x65\x72\x22\x3E\x3C\x2F\x64\x69\x76\x3E","\x61\x70\x70\x65\x6E\x64","\x23\x73\x68\x6F\x77\x74\x61\x67\x65\x6E\x61\x62\x6C\x65\x64","\x3C\x64\x69\x76\x20\x69\x64\x3D\x22\x43\x65\x6C\x65\x62\x72\x69\x74\x79\x54\x61\x67\x43\x6F\x6E\x74\x61\x69\x6E\x65\x72\x22\x3E\x3C\x2F\x64\x69\x76\x3E","\x3C\x64\x69\x76\x20\x69\x64\x3D\x22\x43\x65\x6C\x65\x62\x72\x69\x74\x79\x44\x65\x74\x61\x69\x6C\x73\x22\x3E\x3C\x2F\x64\x69\x76\x3E","\x3C\x64\x69\x76\x20\x69\x64\x3D\x22\x50\x72\x6F\x64\x75\x63\x74\x43\x6F\x6E\x74\x61\x69\x6E\x65\x72\x22\x3E\x3C\x2F\x64\x69\x76\x3E"];var
})
and what i would like to archieve is that i can place the code block of obfuscated code in my azure storage and that it's loaded (imported) into the rest of the javascript file. This way i could make changes for the client remotely, add features etc. What would be the best way of doing this?
I looked into stackoverflow: How do I include a JavaScript file in another JavaScript file? but that is now 9 years old and perhaps better new way exist now.
would this be possible?
$(function () {
var id_user = XXXX; // this is what the client needs to connect
$.getScript("http://myweb.azurestorage.net/Obfuscated_Code.js", function());
})
where on the storage the Obfuscated Code is hosted, i know this is jquery what is fine to use as well