Simple Parameter Passing Problem

Y

Yang

I have a javascript as follows:

<script type = "text/javascript" src = "http://something.com?
id=abcde&name=something"></script>

now, I want to repalce the id=abcde with some parameters from another
script, say
<script type="text/javascript">
var myid = abcdef;
</script>

I tried scr = "http://something.com/id="+myid+"&name=something">, but
it doesn't work.
Isn't it the same as Java?
 
W

Walton

I have a javascript as follows:

<script type = "text/javascript" src = "http://something.com?
id=abcde&name=something"></script>

now, I want to repalce the id=abcde with some parameters from another
script, say
<script type="text/javascript">
var myid = abcdef;
</script>

I tried scr = "http://something.com/id="+myid+"&name=something">, but
it doesn't work.
Isn't it the same as Java?

a way to do this is to generate your second script tag with javascript
and put it in your page.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top