On the surface, I'd recommend
- using the name of the file to
- re-request it from the server,
- store it into a string var
- search through that string
質問
Okay, so this is a weird situation. I have a JS file with a string:
"@here This is a string";
What I'd like to do is define a function that finds and parses this file. It can search for a string with '@here in it, then allow me to parse it.
Is this possible? I'm not sure if there's a way to search the JS file you're in for strings (the string is declared before the function, if that helps).
UPDATE:
For the record, this string is generated by TestCafe, and to my knowledge I'm not sure if there's a way for me to modify it or assign it to a variable. I haven't been able to start, because I'm not sure if there's a way to parse the document I'm in with the script itself -- (kind-of inception-like!) and I wanted to see if there was anyway to do it.
If anyone is familiar with TestCafe-centric solution as well, that would be great!
解決
On the surface, I'd recommend