i've got this:
in my php/html file. It includes the whole something.js file. In this file, there are lines like with "document.write..." that are writing some text on my page.
Is it possible to replace a string that is included from this js file in my php document? I can't change the js file (I don't have access to it).
The .js file looks like this:
... var msg = ''; msg +='<b>mystring1</b><br/><i>mystring2</i>'; document.write(msg); ...
My php file includes the js file. I wanna change the mystring2 to myteststring in PHP. Is this possible? How? Thanks.
You can't do this cleanly.
If the .js file is calling document.write() inline and it doesn't access any external variables or functions you really don't have any control over it. You could perhaps redefine document.write() but that's ugly.
I suggest you either maintain your own copy of that .js file or change the document a second time using another script executed from the window.onload event.