简体   繁体   中英

How can I use a url to search for text in a different html page without leaving the page with the url?

I want to use JavaScript/Node.js to find a specific word/value after the word 'status: ' that exists in a html page. I want to do this so that I can display this word/value on the SAME html page that contains the url that forwards the user to the html page in which 'status: ' exists. How can I do this?

I have tried to look up ways to do this but having a hard time. Would it combine some sort of a curl request and regex?

The way this should work is I, the user,should be able to go to a page where I can see 'passed' (or some other value) because this page contains a url that forwards the user to a separate html page that says 'status: passed', for example.

Solution: The link will be open when the mouse moves over the text. It returns a newly-created window, or NULL if the call gets failed.

Syntax:

window.open(URL, name, Specs)

Parameters: This function accepts three parameters as mentioned above and described below:

  • URL : It is an optional parameter. It is used to specify the URL of the web page which needs to open. If the URL is not specified then a new window is open.

  • Name : It is an optional parameter which is used to specify the target attribute.

    • _blank : The URL is loaded into the new window. It is optional.
    • _top : The URL replaces the current page.
  • Specs : It is an optional parameter. It is a comma-separated list of items, no whitespace.

    • Height : It represents the height of the window in the pixel.
    • Width : It represents the width of the window in the pixel.

Note: Allow Pop-up of Web Browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM