How to display values from another website to an new html page?

Posted by user3098728 on Programmers See other posts from Programmers or by user3098728
Published on 2014-08-20T10:04:36Z Indexed on 2014/08/20 10:31 UTC
Read the original article Hit count: 357

Filed under:
|

How to display the value in a new html file from different website? This an example field of values that need to display into new html file and I want to display the said values in the input box (Contract ID) of this page JSFiddle. I have 2 JS code that would display that values, but unfortunately its not working and I dont know how to display that value in html input box. Please help me. Thank you

I want to display the said value in this input box:

Here the JS file to read the values:

function scanLapVerification() {
try {
var page_title = "Title";
var el = getElement(document, "class", "view-operator-verification-title", "");
if (!el || el.length == 0) return;
if (el[0].innerText != page_title) return;
var page_title = '';
var el = getElement(document, "class", "workflowActivityDetailPanel", "");
if (el && el.length > 0) {
var eltr = getElement(el[0], "tag", "tr", "");
if (eltr && eltr.length > 0) {
//Read Contract ID
var contractId = {
  CI: { id: null }
};
var con_id = null;
for (var i = 0; i < eltr.length; i++) {
  tr_text = eltr[i].innerText;
  if (tr_text.substr(0, "Contract ID".length) == "Contract ID") con_id = "CI";
  if (con_id && tr_text.substr(0, "Contract ID".length) == "Contract ID") {
      contractId[con_id].id = tr_text.substr("Contract ID".length + 1, tr_text.length - "Contract ID".length - 1);
  }
}
var contract_id = contractId.CI.id;
return { content: "cid_check", con_id: con_id };
}
return { status: "KO" };
} catch (e) {
alert("Exception: scanLapVerification\n" + e.Description);
return { status: "KO", message: e };
}
};

And here's the 2nd JS that display to a new html page:

function scanLapVerification() {
chrome.tabs.sendRequest(tabLapVerification, { method: "scanLapVerification" },
function (response) {
msgbox("receiveResponse: scanLapVerification " + jsonToString(response, "JSON"));
//maintaining state in the background
if (response.data.content == "cid_check") {
        //Popup window features
        var popupWindow = null;
        var name;
        var width = 550;
        var height = 200;
        var left = parseInt((screen.availWidth / 2) - (width / 2));
        var top = parseInt((screen.availHeight / 2) - (height / 2));
        var windowFeatures = "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;

        //Input new address with popup window
        if (confirm("Does the client has new address?") == true) {
            popupWindow = window.open('/htmlname.htm', "title", windowFeatures + encodeURIComponent(response.data.contract_id));
            popupWindow.focus();
        } else {
            name = "";
        }
    });
  }

© Programmers or respective owner

Related posts about JavaScript

Related posts about html