1

I don't have any coding experience. Apologies in advance if question is silly.

I'd like to understand how to "discover" a string that I can add to an existing internal-domain-url (obviously I'm not an admin of that domain) to use its search function. Or to automate that search a little.

Example: Domain: internaldomain.intranet.home An idea of string: /?search=VALUE

Search "button" on the existing domain when used does not change the URL at all. I'm clueless as to what the search string could be. But the search function works as intended of course.

I tried using "Inspect Element" and "Network" tab in my browser to find out but couldn't figure it out. It looks like it's invoking a java script.

<td>

Search

<select name="ctl00$ContentPlaceHolder1$ddlSearchColumn" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$ddlSearchColumn\',\'\')', 0)" id="ctl00_ContentPlaceHolder1_ddlSearchColumn">
        <option selected="selected" value="IP">IP</option>
        <option value="Subnet, Gateway">Subnet, Gateway</option>
        <option value="Fullname">Fullname</option>

    </select>

<input name="ctl00$ContentPlaceHolder1$TextBoxSearchValue" id="ctl00_ContentPlaceHolder1_TextBoxSearchValue" style="width:200px;" autocomplete="off" type="text">

<ul id="ctl00_ContentPlaceHolder1_AutoCompleteExtenderCWID_completionListElem" style="text-align: left; visibility: hidden; cursor: default; list-style: outside none none; padding: 0px; border: 1px solid buttonshadow; background-color: window; color: windowtext; display: none; position: absolute;"></ul>

<input name="ctl00$ContentPlaceHolder1$btnShowAccountStatus" value="Start" id="ctl00_ContentPlaceHolder1_btnShowAccountStatus" style="width:140px;margin-left: 40px;" type="submit">

</td>

I've inspected the "search" function code and pasted it above. I'm hoping this will help you to understand my issue. I want to be able to visit url that will allow me to automatically search for "VALUE", instead of going to the website, typing "VALUE" manually into search field and clicking search button.

Something like: internaldomain.intranet.home/?search=VALUE

Many Thanks, Ponyrius

Ponyrius
  • 11
  • 1
  • Possible duplicate of [How to get the value from the GET parameters?](https://stackoverflow.com/questions/979975/how-to-get-the-value-from-the-get-parameters) – Dupinder Singh Apr 28 '19 at 09:29
  • My lack of coding skills doesn't make it easy to understand the answers in linked topic. Also, I don't own the mentioned website, nor I have admin rights to the machine that can access the local domain from. I was hoping to find an easier method. E.g. there are two other internal domains, I needed the search query for, and was able to find it by simply right clicking search field, using "Add a Keyword for this Search.." option in the browser, and by opening new tab I could find the required strings. Examples: site1.internal/1.asp?Topic=MainDoSearch& site2.internal/search.php?query=%s – Ponyrius Apr 28 '19 at 13:41
  • Bu the website I mentioned in the main section of this topic, doesn't give any results for this method. url doesn't change. – Ponyrius Apr 28 '19 at 13:42
  • did you try to run following code in the answer? – Dupinder Singh Apr 28 '19 at 13:50

1 Answers1

0

this look like duplicate to: How to get the value from the GET parameters?

But if you still need answer, follow this code

var url_string = "internaldomain.intranet.home/?search=VALUE"; //window.location.href
var url = new URL(url_string);
var c = url.searchParams.get("search");
console.log(c);
Dupinder Singh
  • 7,175
  • 6
  • 37
  • 61