Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript in a database 1

Status
Not open for further replies.

timgerr

IS-IT--Management
Jan 22, 2004
364
US
Is there a way (any information) on executing javascript that is stored within a database?

I want to store some of my code in a database and execute it after a database call.

thank you,
timgerr

-How important does a person have to be before they are considered assassinated instead of just murdered?
-Need more cow bell!!!

 
I want to store some of my code in a database and execute it after a database call.

Dynamically, or only when the page initially loads?

If you want to do it when the page initially loads, pull the code out of the database and throw it straight to the page (making sure that it's between <script> tags).

If you want to do it dynamically, then you're probably looking at some sort of ajax solution. The tool that's really going to be doing the magic here is the eval function. I recommend against using it about 99% of the time, but in this instance it might actually be necessary.

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson

[small]<P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top