I have an html page.
I am making an ajax call to a link and i get the html data which contains sId and sTmp values in it. I need to get all the values of sId and sTmp as key value pairs in my html page.
(There are about 106 sId's and sTmp values)
How to get all the values of sId and sTmp as key value pairs ?
Code of html data which contains sId and sTmp values:-
sId = "1407900387";
if ((3 == 13) && "")
{
var sLinkLocation = sAddJavascriptEscapes('');
sUrl = "OpenInformationItemLocation(\"" + sLinkLocation + "\", );";
}
else
sUrl = "OpenHeaderLinkFromTable(\"http://172.220.1.4/QPR2014-1/Portal/QPR.Isapi.dll?PGPLUGIN&*24&SES=mWh8OHy43bW3LC5kC9yM-A&FMT=p&SKIN=portal&LAN=en%2c1&MODELID=1470448858&OBJECTID=1407900387\",\"http://172.220.1.4/QPR2014-1/Portal/QPR.Isapi.dll?PGPLUGIN&*24&SES=mWh8OHy43bW3LC5kC9yM-A&FMT=p&SKIN=portal&LAN=en%2c1&MODELID=1470448858&OBJECTID=1407900387\",\"" + sId + "\");";
window._sDefaultLink = window._sDefaultLink || sUrl;
RC("<table border='0' cellpadding='0' cellspacing='0'><tr><td><a id=\"a" + sId + "\" href='java<!-- no -->script:" + sUrl + "' title='" + sTmp + "'><img src='http://172.220.1.4/QPR2014-1/qprsoftware/pg/images/icn_subprocess.gif' title='" + sTmp2 + "'> " + sTmp + "<\/a>" + sTools + "</td></tr></table>", sTmp);
sTmp = "";
if (sTmp != "")
sTmp = "<table border='0' cellspacing='0' cellpadding='0'>" + sDecodeURI(sTmp) + "</table>";
RC(sTmp, "");
Code of html page:-
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<script src="jquery.js"></script>
<script type="text/javascript">
function dataRet (d){
console.log(d);
}
function ajaxreq(){
debugger
$.ajax({
url: *some link*
error: function(jqxhr) {
alert(jqxhr.responseText);
},
dataType:'html',
success: function(data) {
alert(data);
console.log(data);
var decoding = sDecodeURI(data);
console.log(decoding);
},
type: 'post'
})
function sDecodeURI(vsStr)
{
debugger
try {
if (typeof(vsStr) !== "string")
return vsStr;
var slSplit = vsStr.split('%u');
if (slSplit.length === 1)
return decodeURIComponent(vsStr);
var sResult = new StringBuilder(decodeURIComponent(slSplit[0]));
for (var i = 1; i < slSplit.length; ++i) {
var sTmp = slSplit[i];
var len = sTmp.length;
if (len < 4)
sResult.append("%u" + sTmp);
else {
var charCode = sTmp.substr(0, 4);
sResult.append(String.fromCharCode(parseInt(charCode,16)));
sResult.append(decodeURIComponent(sTmp.substr(4, sTmp.length-4)));
}
}
return sResult.toString();
}
catch (e) {
return unescape(vsStr);
}
}
;
}
</script></head>
<body>
<input onclick="ajaxreq()" type="button" value="Click me to load info!"></input>
<div id="info"></div>
</body>
</html>
What I have tried:
I have tried to call the data using substring and indexOf but i don't get the values..