Information Technology Questions and Answers Community

Questions/Title


   Asked Questions

Views
71
Answers
1
Action
Views
77
Answers
1
Action
Views
58
Answers
1
Action
Views
58
Answers
1
Action
Views
68
Answers
1
Action
Views
118
Answers
1
Action
Views
77
Answers
1
Action
Views
64
Answers
1
Action
Views
102
Answers
1
Action
Views
60
Answers
1
Action
Views
57
Answers
1
Action
Views
81
Answers
1
Action
Views
70
Answers
1
Action
Views
86
Answers
1
Action
Views
71
Answers
1
Action
Views
71
Answers
1
Action
Views
119
Answers
1
Action
Views
114
Answers
1
Action
Views
73
Answers
1
Action
Views
73
Answers
2
Action
Views
93
Answers
1
Action
Views
95
Answers
2
Action
Views
78
Answers
1
Action
Views
71
Answers
1
Action
Views
79
Answers
2
Action
Views
67
Answers
2
Action
Views
69
Answers
1
Action
Views
96
Answers
1
Action

I think my question is a little bit more complicated than what I saw on the internet because I need to make multiple filtrations on a single table. So here's my code:

 

Views
88
Answers
0
Action

I want to place my Paragraph next to a when screen is to small. I tried positions and widhts but i think some other css element is blocking it. I cant find out why.

EDIT: On a big screen you see on the left side a box of text and floated to the right a login box. I want the login box always next to the Paragraph instead of a line under the paragraph.

I wil add my css and html below in a jfiddle

Jfiddle: https://jsfiddle.net/c6odvLt0/ (set your window width bigger to see what i mean.

                <div class="content">
                <div class="article">
                    <h1>Welkom</h1>
            <h2>Baas over eigen data</h2>
            <p>Bij Databaas.nl kunt u snel en gemakkelijk uw data uploaden en beheren.<br />
            U word weer baas over eigen data.<br />
            Registreer u nu of log in met uw bestaande account.<br /></p>
                <div class="login">
                    <h1>Inloggen</h1>
                    <h4>'.$warning_login.'</h4>
                    <form method="post" action="index.php" class="inlogform">
                        <input type="text" name="username_log" placeholder="Gebruikersnaam">
                        <input type="password" name="password_log" placeholder="Wachtwoord"><br>
                        <input type="hidden" name="hidden_log">
                        <input type="submit" name="submit_log" value="Log In">
                    </form>
                    <a href="registreren.php"><h3>Registreren</h3></a>
                </div><br>
                </div>
                <footer>
                    Door Timo Verberne en Calvin Bots
                </footer>
            </div>
Views
84
Answers
0
Action

For a chrome plugin i need to retrieve messages. These messages are supplied to me through a html variable.

 

There are 2 messages in the example wich is provided below and they start with: <tr bgcolor="#FFFFFF"> and end with: </tr>

 

I retrieved the first message data but now i need to make it so it retrieves all the data from each of those <tr bgcolor="#FFFFFF"> </tr> messages.

 

What i get provided:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

 

<html>

 

<head>

  <link rel="STYLESHEET" type="text/css" href="xxx">

  <title>Untitled</title>

</head>

 

<body class="bodySinScrollHor">

 

 

  <table width="95%" align="center">

    <tr>

      <td class="etiquetaIzquierda" colspan=6>

        <a class="etiquetaIzquierda"><img border=0 height=15 src="xxx"> &nbsp;Comunicaciones (2)</a>

      </td>

      </td>

    </tr>

    <tr>

      <td colspan=6>

        <hr size=1 width="100%">

      </td>

    </tr>

    <tr id="comunicaciones">

      <td colspan=6>

        <table width="100%" border=0 bordercolor="#000000" cellspacing=0 cellpadding=0>

 

          <tr bgcolor="#FFFFFF">

            <td width="9%" class="valorCampoSinTamFijoPeque">2017-08-31T00:00:00</td>

            <td width="9%" class="valorCampoSinTamFijoPeque">13:22</td>

            <td width="4%" align=left class="valorcampoSinTamFijoPeque">

              <img src="xxx" title=" Out"> &nbsp; &nbsp;

            </td>

            <td width="11%" class="valorCampoSinTamFijoPeque" valign=top>

              <font class="valorcampoSinTamFijoPeque"><a title="clientname" class="valorcampoSinTamFijoPeque">ClientName</a></font>

            </td>

            <td width="14%" class="valorCampoSinTamFijoPeque" width="100%">Subject</td>

            <!-- <td width="61%"class="valorCampoSinTamFijoPeque">message text here</td> -->

          </tr>

 

          <tr bgcolor="#FFFFFF">

            <td width="9%" class="valorCampoSinTamFijoPeque">2017-08-31T00:00:00</td>

            <td width="9%" class="valorCampoSinTamFijoPeque">13:21</td>

            <td width="4%" align=left class="valorcampoSinTamFijoPeque">

              <img src="xxx" title=" Out"> &nbsp; &nbsp;

            </td>

            <td width="11%" class="valorCampoSinTamFijoPeque" valign=top>

              <font class="valorcampoSinTamFijoPeque"><a title="clientname" class="valorcampoSinTamFijoPeque">ClientName</a></font>

            </td>

            <td width="14%" class="valorCampoSinTamFijoPeque" width="100%">Subject</td>

            <!-- <td width="61%"class="valorCampoSinTamFijoPeque">Message Text Here</td> -->

          </tr>

 

      </td>

    </tr>

    </table>

 

    </td>

    </tr>

  </table>

 

</body>

 

</html>

 Run code snippetExpand snippet

The code i run to retrieve the data from the first message (note that there are 2 messages in this case, but there are people that have 54 messages so it needs to loop that many times. this code //Get count of regex matches. (amount of messages)

    var count = (html1.match(/<tr bgcolor="#FFFFFF">/g) || []).length;

    console.log(count); provides that number for me) :

 

matches[0].forEach(function(match, index) {

  var cleintcode = /<div\s*class="t_seg_codCliente">(.*?)<\/div>/.exec(match)[1];

  var cleintname = /<div\s*class="t_seg_nomCliente">(.*?)<\/div>/.exec(match)[1];

  var taxId = /<div\s*class="t_seg_nifCliente">(.*?)<\/div>/.exec(match)[1];

  var date = /<div\s*class="t_seg_fechaPresCliente">(.*?)<\/div>/.exec(match)[1];

  var state = /<div\s*class="t_seg_estadoCliente">(.*?)<\/div>/.exec(match)[1];

  var expirydate = /<div\s*class="t_seg_fechaCadCliente">(.*?)<\/div>/.exec(match)[1];

  var communications = /<div\s*class="t_seg_comCliente"><a .*;">(.*?)<\/a>/.exec(match)[1];

  var comclient = /<div\s*class="t_seg_comCliente"><a href="javaScript:popupComs\('(.*?)'/.exec(match)[1];

  var messages = "xxx" + comclient;

 

  var html1 = httpGet(messages);

 

  //console.log(html1);

 

  const cleanupDocString = html1.replace(/(?:<!--|-->)/gm, '');

 

  parser = new DOMParser();

 

  htmlDoc = parser.parseFromString(cleanupDocString, "text/html");

 

  //console.log(htmlDoc);

 

  var communicationsvalue = htmlDoc.getElementsByClassName("valorCampoSinTamFijoPeque")[0].textContent;

 

  if (communicationsvalue.indexOf('No existen comunicaciones asociadas a este cliente.') !== -1) {

    console.log("This chat does not contain any communiction!");

  } else {

 

    //Get count of regex matches. (amount of messages)

    var count = (html1.match(/<tr bgcolor="#FFFFFF">/g) || []).length;

    console.log(count);

 

    var comDate = htmlDoc.getElementsByClassName("valorCampoSinTamFijoPeque")[0].textContent;

    var comTime = htmlDoc.getElementsByClassName("valorCampoSinTamFijoPeque")[1].textContent;

    var comType = htmlDoc.getElementsByTagName('img')[1].src;

    var comClient = htmlDoc.getElementsByTagName('a')[1].textContent;

    var comSubject = htmlDoc.getElementsByClassName("valorCampoSinTamFijoPeque")[6].textContent;

 

    const element = htmlDoc.getElementsByClassName('valorCampoSinTamFijoPeque')[7];

 

    var pulledMessage = element.innerHTML;

 

    var messageData = [{

        clientCode: cleintcode,

        clientName: cleintname,

        taxID: taxId,

        cleintDate: date,

        cleintState: state,

        cleintExpirydate: expirydate

      },

      {

        mesDate: comDate,

        mesTime: comTime,

        mesType: comType,

        mesClient: comClient,

        mesSubject: comSubject,

        mesText: pulledMessage

      }

    ];

    console.log(messageData);

  }

});

 Run code snippetExpand snippet

The code above gives me this console log:

 

0:

cleintDate:"31/08/17"

cleintExpirydate:"29/11/17"

cleintState:"Subject"

clientCode:"xxxxxx"

clientName:"clientName"

taxID:""

proto:Object

1:

mesClient:"ClientName"

mesDate:"2017-08-31T00:00:00"

mesSubject:"Subject "

mesText:"Message text Here"

mesTime:"13:22"

mesType:"link"

proto:Object

note that array 0 should not change because these messages are from the same person. I just need to grab the second message aswell. So i technically need a second array like array 1 containing the data from the second message.

 

Wanted result:

 

0:

cleintDate:"31/08/17"

cleintExpirydate:"29/11/17"

cleintState:"Subject"

clientCode:"xxxxxx"

clientName:"clientName"

taxID:""

proto:Object

1:

mesClient:"ClientName"

mesDate:"2017-08-31T00:00:00"

mesSubject:"Subject "

mesText:"Message text Here"

mesTime:"13:22"

mesType:"link"

proto:Object

3:

mesClient:"ClientName"

mesDate:"2017-08-31T00:00:00"

mesSubject:"Subject "

mesText:"Message text Here"

mesTime:"13:22"

mesType:"link"

proto:Object

I know i have to build a for loop but i have no idea on how do this so it looks for the second <tr bgcolor="#FFFFFF"> </tr> after the first.

 

I hope my question is clear! And i hope you guys can teach me.

 

content is slightly edited to hide personal information.

Views
70
Answers
0
Action
Edit Account
LOGIN INFORMATION
Change Settings
Email Notifications Notifications will be sent to abcd@gmail.com
Select option for your email notifications:
Mature / News Filter We'll send on email when new jobs are posted
Option 2 for email notification We'll send on email when new jobs are posted