Reputation: 1901
This is the simple script i'm trying to run, i've also tried it with only the alert but it just doesn't work. If it's any help, it's part of a html block i'm echoing from a php script.
<script type="text/Javascript">
alert(\'test\');
JACS.show(document.getElementById(\'data_jacs\'),\'jacsStatic2\');
</script>
I found the problem and it has nothing to do with the script, it has everything to do with the php file i'm echoing it from being loaded with AJAX. Thanks for the help.
Upvotes: 0
Views: 3528
Reputation: 856
You should put this code behind the tag.
Or you can do:
window.onload=function(){
alert(\'test\');
JACS.show(document.getElementById(\'data_jacs\'),\'jacsStatic2\');
}
Upvotes: 0
Reputation: 30638
it returns error so to execute it and catch exception you need to specify try catch block
<script>
alert('test');
try
{
JACS.show(document.getElementById('data_jacs'),'jacsStatic2');
}
catch(err){
alert(err);
}
</script>
it alerts an error JACS library not defined.
Upvotes: 0
Reputation: 3446
Might be more then one reason:
Don't use slashes:
alert('test');
You're using JACS. Are you sure the JACS library is loaded by the time this script tag is being executed?
Upvotes: 1