change script tag attribute

Argonaut
Argonaut used Ask the Experts™
on
I have a 3rd party JavaScript file I need to load by using the 'scr' attribute of a script tag.  This scr has a querystring that I need to be able to change from a client script that I write.  Example:

<script language='JavaScript' src='http://www.anotherdomain.com/someoneelses.js?type=1></script>

How can I change the querystring data in this src attribute so that the proper data is sent?  
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
download the .js and change whatever you want...

with a download tool (download accelerator, getright, netants, etc.)... in add URL type: http://www.anotherdomain.com/someoneelses.js

and that's it!

cheers =0)

Author

Commented:
:) sorry it ain't that easy, the js is generated dynamically by the provider.

Commented:
then... you're not able to modified it...

SORRY!!! =0)
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
Well there is  one way that I though of but I'm looking for something cleaner.

I could generate the src attribute with the querystring data that is needed, save it in a cookie, refresh the page, dump the entire script tag with the querystring data from the cookie to the inside of a div tag.
Argonaut,

try this approach:

document.writeln("<script language='JavaScript' ");
document.writeln("src='http://www.somedomain.com/aJS.js?");
document.writeln(aKey + "=" + aValue + "></script>");

cheers,

Author

Commented:
The document.writeline would have to be inside a script tag so this would result in a script tag inside a script tag. Also once the script is run it does not run again, in this case it would result in just writing the data and not executing it.

This problem could be solved easy if I could use some server script but no can do.

Since there appears not to be a solution, I will delete this question.

Commented:
Dear expert(s),

A request has been made to delete this Q in CS:
http://www.experts-exchange.com/Community_Support/CleanUp/Q_20413888.html

Without a response in 72 hrs, a moderator will finalize this question by:

 - Saving this Q as a PAQ and refunding the points to the questionner

When you agree or disagree, please add a comment here.

Thank you.

modulo

Community Support Moderator
Experts Exchange
Points refunded and moved to PAQ

** Mindphaser - Community Support Moderator **

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial