Hi.
I want to run a javascript in detail view. I have succeeded in that too. But the javascript code I added, runs 2 times each time.
For example, I’ve included a javascript file that just throws a warning. The code is below.
Every time I refresh the page, this warning message comes up 2 times in a row.
why could it be?
I edited detailviewdefs.php file as follows.
custom/modules/Contacts/metadata/detailviewdefs.php
......
'includes' =>
array (
0 =>
array (
'file' => 'modules/Contacts/Contact.js',
'file' => 'custom/modules/Contacts/js/mytest.js',
),
),
...........
Contents of my mytest.js file;
custom/modules/Contacts/js/mytest.js
$(document).ready(function(){
window.alert("this is test");
});