change script tag attribute

Argonaut used Ask the Experts™
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='></script>

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

Do more with

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

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

with a download tool (download accelerator, getright, netants, etc.)... in add URL type:

and that's it!

cheers =0)


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

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!


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.

try this approach:

document.writeln("<script language='JavaScript' ");
document.writeln(aKey + "=" + aValue + "></script>");



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.

Dear expert(s),

A request has been made to delete this Q in CS:

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.


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