Recently I faced a strange problem in javascript, I wanted to pass window.location.href in javascript src tag, but In javascript following holds true
Following is the quick hack which can be used for it
<script type='text/javascript'>
var pid = encodeURIComponent(window.location.href);
var jis='http://somehost&u='+pid;
document.writeln("<script type='text\/javascript' src="+jis+"><\/script>");
</script>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment