Click to See Complete Forum and Search --> : Passing Variable to html code


rcaubin
06-03-2004, 05:09 PM
I've declared a variable in Javascript

I need to call an external javascript source with this variable... Example:

var varKeyword = "This Keyword"
</script>

<script src="http://external.com/sourcefile.jsp?keyword=X">

I need to put the value of varKeyword at X in the above location

This may be really easy, but I have no clue.

Virbatem
06-03-2004, 05:56 PM
keyWord="this keyword";

document.write('<script src="http://external.com/sourcefile.jsp?keyword='+keyWord+'"></scr'+'ipt>');

rcaubin
06-03-2004, 06:44 PM
Sweet! works like a charm!