•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 361,552 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,111 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 891 | Replies: 6 | Solved
![]() |
Is it possible to overwrite internal javascript? I am working for a non profit as an internship and they want to escape a template that almost all of the non profits in that organization have to use, the catch is the template is written in Javascript if it is possible to over ride it please tell me as I really need to know ASAP.
I may not always be correct.
•
•
Join Date: Aug 2006
Location: Noida, India
Posts: 138
Reputation:
Rep Power: 2
Solved Threads: 14
my be this would(i have not tired it). Javascript code are written in <script></script> tags. So search these tags in the document by using: var sTag = document.getElementsByTagName("script"). This will give u an array of script tags. Now over write them by using sTag[0].innerHTML = "your javascript code";
If this work please let me know?
If this work please let me know?
•
•
•
•
my be this would(i have not tired it). Javascript code are written in <script></script> tags. So search these tags in the document by using: var sTag = document.getElementsByTagName("script"). This will give u an array of script tags. Now over write them by using sTag[0].innerHTML = "your javascript code";
If this work please let me know?
I am sorry I do not completly understand, are you saying to look in the edocument for the code you listed? If so the code isn't there if you mean something else please pm me or post.
I may not always be correct.
•
•
•
•
I am sorry I do not completly understand, are you saying to look in the edocument for the code you listed? If so the code isn't there if you mean something else please pm me or post.
Okay I have searched the whole javascript and they do not use the var command at all they use javascript in a odd way just for images. If there is a way to overwrite it I would be happy and so would my boss.
I may not always be correct.
•
•
Join Date: Aug 2006
Location: Noida, India
Posts: 138
Reputation:
Rep Power: 2
Solved Threads: 14
Hi tiger86, if u can explain ur problem little bit more, i want to know what exactly u want to do.
var is not a command but a way to declare a variable in javascript.
I am explaining my prev. post again, if u still did not get ur problem solved, explain ur problem in detail.
first i want to tell u what i understand from ur post: You want to overwrite the javacript at run-time. if this is correct then my post will help u otherwise explain me ur problem. here is want i explained in prev post. for example u have a page:
if u want to change js code in above page,
this a js code todo that :
var tags = document.getElementsByTagName("script");
//Now changing the js code
tags[0].innerHTML = "your new js code should be written here as a string";
again i had not tested it. please let me know how it works?
var is not a command but a way to declare a variable in javascript.
I am explaining my prev. post again, if u still did not get ur problem solved, explain ur problem in detail.
first i want to tell u what i understand from ur post: You want to overwrite the javacript at run-time. if this is correct then my post will help u otherwise explain me ur problem. here is want i explained in prev post. for example u have a page:
html Syntax (Toggle Plain Text)
<html> <head></head> <body> <script> function myfunct() { //do something } </script> </body> </html>
if u want to change js code in above page,
this a js code todo that :
var tags = document.getElementsByTagName("script");
//Now changing the js code
tags[0].innerHTML = "your new js code should be written here as a string";
again i had not tested it. please let me know how it works?
Last edited by peter_budo : Apr 30th, 2008 at 7:51 am. Reason: Keep It Organized - plase use [code] tags
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
- Frame detection possible? (HTML and CSS)
- noobie asking for assistance with file parsing... (Perl)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: FireFox: Forcing hand over table-cell doesn't work
- Next Thread: Rotating image gallery - highlight border of current image displayed


Linear Mode