Luis Valencia
Luis Valencia

Reputation: 34028

Where is this javascript defined in Magento?

I am trying to make my site 100% valid according to W3C.

My site is: www.theprinterdepo.com

The validation report is here: http://validator.w3.org/check?uri=http%3A%2F%2Fwww.theprinterdepo.com%2F&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3

There is one javascript code that I need to fix according to that page but I cant find where is it located I already tried header.phtml and head.phtml in my template folder but its not there

the js is this:

<script type="text/javascript">window.HDUSeed='6780a8396c4a7207c8e81d509cbafa79';
window.HDUSeedIntId = setInterval(function(){
if (document.observe) {
document.observe('dom:loaded', function(){
for (var i = 0; i < document.forms.length; i++) {
if (document.forms[i].getAttribute('action') && document.forms[i].getAttribute('action').match('contacts/index/post')) {
var el = document.createElement('input');
el.type = ('hidden');
el.name = 'hdu_seed';
el.value = window.HDUSeed;
document.forms[i].appendChild(el);
}
}
});
clearInterval(window.HDUSeedIntId)
}
}, 100)</script>

The question is in which magento file can I check this and fix it?

Upvotes: 1

Views: 460

Answers (2)

Drew Hunter
Drew Hunter

Reputation: 10114

Jürgen Thelen is correct in his comment - it looks as though you are using a 3rd party extension - most likely this one from Ahead Works: http://ecommerce.aheadworks.com/magento-extensions/help-desk-ultimate.html - so you may want to ask them to fix the issue. Or if you do resolve it then maybe feed the fix back to them.

Regardless though, just find something unique (perhaps: 'hdu_seed') in the code you are looking for and grep for it in your source code. The following recursively grep and show file names of any matches (run from your web root):

grep -lr "hdu_seed" .

If you cant use the command line to grep for whatever reason, use a tool such as notepad++ or netbeans to perform your search.

To narrow down your search, the code you are looking for will most likely be in a js file, js_skin file, template file or being generated in a Block.

Upvotes: 2

Sturm
Sturm

Reputation: 4285

grep -r "clearInterval(window.HDUSeedIntId)" *

If that doesn't work you can use

 echo "<larger part of script>"
 read var_name
 grep -r $var_name *

Upvotes: 1

Related Questions