This example shows how to redirect to a url:
<meta http-equiv="refresh" content="0; url=http://example.com/" />
But, i do not want to redirect to a url, i want to redirect to a javascript snippet:
javascript:(function(){s=document.createElement("script");s.type="text/javascript";s.src="https://www.diigo.com/javascripts/webtoolbar/diigolet_b_h_b.js";document.body.appendChild(s);})();
Goal is to do this with a single file.
I tried replacing the url in the meta redirect above with my js snippet, but it fails. I believe the problem is the double-quotes embedded in the js:
<meta http-equiv="refresh" content="0; url=javascript:(function(){s=document.createElement("script");s.type="text/javascript";s.src="https://www.diigo.com/javascripts/webtoolbar/diigolet_b_h_b.js";document.body.appendChild(s);})();" />
I tried replacing the double-quotes in the js with "
but that did not work. Also tried %22, also did not work.
I'm not trying to redirect using javascript, i'm trying to redirect to javascript (using meta or another non-js method). However, if there's a way to execute the above script using another piece of script, that's fine.
Not trying to redirect to a .js file-- i want to embed the js snippet inside the redirect.
This question is not a duplicate, because they are not redirecting a page, they are redirecting a link.